Creating the random solution
- Start with a blank string.
- For the number of pegs:
- pick a random number between 0 and one less than the number of colors
- concatenate that digit (integer) to the string
This topic: CenterForComputing
> WebHome >
Syllabi >
CSC121SylF2026 >
CSC121F2026Lab07 > CSC121F2026Lab07Hint02
Topic revision: r1 - 2026-06-04 - CathyBareiss