games · MIT License
Overview
A number guessing game with three levels: find the secret number in as few tries as you can, with a too high or too low hint after every guess.
- Owner-tested on a TI calculator
- Version 1.0.0
- 2181 bytes
- Uses random
Tried it? Did this program work on your calculator?
Before you run it
- TI-84 Plus CE Python · No calculator OS or Python App version has been verified.
- TI Connect CE .py transfer to the Python App; the owner's transfer details were not recorded
- The secret number is chosen at random by the calculator for each round.
- Wins and losses are kept only while the program is running.
- Levels and guesses must be whole numbers; anything else asks again.
Play it here first
Play a full round right here before you download. The screen below runs the same steps as the calculator game: type your answer in the box under it and press Enter, just as you would on the calculator. Each round picks a new secret, and nothing you type is saved.
TI-84 Plus CE Python · screen preview
How to play
How to play Guess the Number
About the game
The calculator picks a secret whole number and you try to find it. After every wrong guess it tells you whether you were too low or too high, so each guess can cut down where the number can be.
Pick one of three levels. Harder levels have a bigger range and only a few more tries, so a good strategy matters more than luck.
Controls
1, 2, or 3- choose Easy (1 to 10, 5 tries), Medium (1 to 50, 7 tries), or Hard (1 to 100, 8 tries)
number keys- type a guess
enter- submit a guess or an answer
Y- play another round; any other answer ends the game
How to play
- Press enter at the opening screen.
- Type 1, 2, or 3 to choose a level.
- Type a guess and press enter. The calculator says Too LOW!, Too HIGH!, or YOU GOT IT!
- If you run out of tries, it shows GAME OVER! and the number it was thinking of.
- After each round it shows your wins, losses, and games played. Type Y to play again.
Tips
- Guess the middle of what is left. On Hard, start at 50; if that is too low, try 75, then keep halving the gap.
- Halving the range finds any number from 1 to 100 within 7 guesses, so Hard's 8 tries are always enough with this strategy.
- A guess outside the range, or a decimal, is not counted. The calculator just asks again.
Good to know
- The win and loss totals start over each time you run the program.
- To stop the game at any time, press the [on] key. The Python App returns to the shell.
Exact reviewed bytes
Source code
from random import randintdef intro():print("DUCKIEDAI(TM)")print("GUESS THE NUMBER")print()print(" __")print(" ___(o )> quack!")print(" \\ <_. )")print(" `---'")print()print("by DuckieDai")print("hiddenwordscanner.com")input("Press Enter ")print("\n"*6)def number(prompt,low,high):while True:try:n=int(input(prompt))if low<=n<=high:return nprint("Enter",low,"to",high)except ValueError:print("Whole numbers only!")def game():wins=0losses=0while True:print("GUESS THE NUMBER")print("1. Easy (1-10)")print("2. Med (1-50)")print("3. Hard (1-100)")mode=number("Level? ",1,3)if mode==1:top=10tries=5elif mode==2:top=50tries=7else:top=100tries=8secret=randint(1,top)left=trieswon=Falseprint("\n"*5)print("I'm thinking of")print("a number 1 to",top)print("You get",tries,"tries!")print("----------------")while left>0:print("Tries left:",left)guess=number("Guess? ",1,top)if guess==secret:print("YOU GOT IT!")print("QUACK QUACK!")won=Truebreakleft-=1if guess<secret:print("Too LOW!")else:print("Too HIGH!")if left>0:print("----------------")if won:wins+=1else:losses+=1print("GAME OVER!")print("Number was:",secret)print("----------------")print("Wins:",wins)print("Losses:",losses)print("Played:",wins+losses)again=input("Again? Y/N: ")if again.upper()!="Y":breakprint("\n"*6)print("\nThanks for playing!")print("DuckieDai (TM)")print("hiddenwordscanner.com")intro()game()
- Filename
GUESNUM.py- Size
- 2181 bytes
- SHA-256
e5a41dc01de53596c6e55be21d7e4d3cdba53dfc1a7a33ade3840d468fa7e9cd
Usage
Inputs
- A level from 1 to 3: Easy 1 to 10, Medium 1 to 50, Hard 1 to 100
- One whole-number guess per try
- Y to play again, anything else to stop
Outputs
- Too LOW or Too HIGH after each wrong guess, with the tries left
- YOU GOT IT on a correct guess, or GAME OVER with the secret number
- Running totals of wins, losses, and games played
Units: Whole numbers; no units.
Assumptions and limitations
Assumptions
- The secret number is chosen at random by the calculator for each round.
- Wins and losses are kept only while the program is running.
Constraints
- Levels and guesses must be whole numbers; anything else asks again.
- A guess outside the level's range asks again and does not use up a try.
Known failures
- A decimal such as 2.5 is not accepted as a guess; the program says Whole numbers only.
- The win and loss totals reset when the program is started again.
Compatibility and review
- Review status
- Owner-tested on a TI calculator
- Tested on
- Owner reports personally playing this game on a TI-84 Plus CE Python calculator; the test date, OS version, and Python App version were not recorded
- What happened
- Owner reported pass on the calculator. The file is published exactly as provided; this exact file has not yet been rerun on a calculator.
- Dependencies
- random
- Suggested calculator name
GUESNUM— you can give it another valid, unique name when you transfer it- Desktop test cases
- Not available for this interactive-only source
This exact source auto-launches an interactive calculator session, so compatibility evidence comes from the recorded physical-device review rather than an importable desktop fixture.
Transfer and launch
Download the .py file, send it to your calculator with TI Connect CE as GUESNUM or another name, then open the Python App and start a game. Press [on] to stop at any time. This release has no verified calculator OS or Python App version; treat transfer and execution as unverified until independently tested.
Full installation and troubleshooting guide. Check your teacher's or exam's rules before using any program.
Version history
- 1.0.0 — current version, published . Download this reviewed version
Related learning
Enjoying a DuckieDai game? Every game and program here is free. If you would like to say thanks, you can leave a tip on Cash App ($duckiedai214) or read what tips pay for.
Independent compatibility resource: Hidden Word Scanner is independent and is not affiliated with or endorsed by Texas Instruments. TI product names describe compatibility only.
Action-count privacy: Successful downloads, preview starts, and preview completions increment same-origin aggregate counters, and so does a Yes or No answer about whether the program worked. Your browser notes that you answered; that note is never sent to the site. No entered values, source text, IP address, account, cookie, device identifier, or fingerprint is stored with these counts.