官术网_书友最值得收藏!

  • Python編程快速上手2
  • (美)阿爾·斯維加特
  • 128字
  • 2022-10-26 17:00:13

運(yùn)行bagels.py,輸出如下所示:

Bagels, a deductive logic game.
By Al Sweigart al@inventwithpython.com
I am thinking of a 3-digit number. Try to guess what it is.
Here are some clues:
When I say:    That means:
  Pico         One digit is correct but in the wrong position.
  Fermi        One digit is correct and in the right position.
  Bagels       No digit is correct.
I have thought up a number.
 You have 10 guesses to get it.
Guess #1:
> 123
Pico
Guess #2:
> 456
Bagels
Guess #3:
> 178
Pico Pico
--snip--
Guess #7:
> 791
Fermi Fermi
Guess #8:
> 701
You got it!
Do you want to play again? (yes or no)
> no
Thanks for playing!
主站蜘蛛池模板: 驻马店市| 通城县| 茌平县| 富阳市| 区。| 衡水市| 洛宁县| 论坛| 肃北| 大悟县| 县级市| 贡嘎县| 乐安县| 左权县| 五台县| 南木林县| 罗平县| 鄂伦春自治旗| 尉氏县| 大方县| 黄冈市| 当雄县| 铜梁县| 浮山县| 武穴市| 东乡族自治县| 颍上县| 高台县| 上蔡县| 家居| 濮阳县| 蕲春县| 城固县| 哈密市| 乌审旗| 西乡县| 莱西市| 长岛县| 南城县| 宜宾县| 松溪县|