Hidden WordScanner
Private scans · No account required

DuckieDai Guess the Number

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.

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

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.

JavaScript is required for the optional browser simulation. Source viewing and downloading remain available without it.

Simulation boundary: This preview uses a reviewed browser adapter. It does not execute the downloaded Python and does not prove TI-Python or calculator compatibility.

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

Tips

Good to know

Exact reviewed bytes

Source code

Download .py

View source below, copy it when JavaScript is available, or download the exact .py bytes.

  1. from random import randint
  2. def intro():
  3. print("DUCKIEDAI(TM)")
  4. print("GUESS THE NUMBER")
  5. print()
  6. print(" __")
  7. print(" ___(o )> quack!")
  8. print(" \\ <_. )")
  9. print(" `---'")
  10. print()
  11. print("by DuckieDai")
  12. print("hiddenwordscanner.com")
  13. input("Press Enter ")
  14. print("\n"*6)
  15. def number(prompt,low,high):
  16. while True:
  17. try:
  18. n=int(input(prompt))
  19. if low<=n<=high:
  20. return n
  21. print("Enter",low,"to",high)
  22. except ValueError:
  23. print("Whole numbers only!")
  24. def game():
  25. wins=0
  26. losses=0
  27. while True:
  28. print("GUESS THE NUMBER")
  29. print("1. Easy (1-10)")
  30. print("2. Med (1-50)")
  31. print("3. Hard (1-100)")
  32. mode=number("Level? ",1,3)
  33. if mode==1:
  34. top=10
  35. tries=5
  36. elif mode==2:
  37. top=50
  38. tries=7
  39. else:
  40. top=100
  41. tries=8
  42. secret=randint(1,top)
  43. left=tries
  44. won=False
  45. print("\n"*5)
  46. print("I'm thinking of")
  47. print("a number 1 to",top)
  48. print("You get",tries,"tries!")
  49. print("----------------")
  50. while left>0:
  51. print("Tries left:",left)
  52. guess=number("Guess? ",1,top)
  53. if guess==secret:
  54. print("YOU GOT IT!")
  55. print("QUACK QUACK!")
  56. won=True
  57. break
  58. left-=1
  59. if guess<secret:
  60. print("Too LOW!")
  61. else:
  62. print("Too HIGH!")
  63. if left>0:
  64. print("----------------")
  65. if won:
  66. wins+=1
  67. else:
  68. losses+=1
  69. print("GAME OVER!")
  70. print("Number was:",secret)
  71. print("----------------")
  72. print("Wins:",wins)
  73. print("Losses:",losses)
  74. print("Played:",wins+losses)
  75. again=input("Again? Y/N: ")
  76. if again.upper()!="Y":
  77. break
  78. print("\n"*6)
  79. print("\nThanks for playing!")
  80. print("DuckieDai (TM)")
  81. print("hiddenwordscanner.com")
  82. intro()
  83. 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

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.