Type in how many hexadecimal digits you want. Counts up, displaying each hexadecimal value. Also displays number of possible combinations for that number of digits.
Created by Phil Gardner
last edited Mar 12 2021 by Phil Gardner
Uses recursion to build sequences of hexadecimal digits.
Useful to demonstrate how adding each new digit allows many more combinations.
Can also use it to demonstrate how large numbers can be represented in a more compact form (especially when compared to binary representations - use in conjunction with the binary counting program posted earlier).
GCSE and A-Level.
In class we have also placed bets on how long it will take the computer to complete the task and how many combinations there will be for a particular number of digits.
Can paste the code into replit.com or compile on Raspberry Pi, Apple mac or Linux PC.