- Python編程快速上手2
- (美)阿爾·斯維加特
- 128字
- 2022-10-26 17:00:13
運(yùn)行程序
運(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!
推薦閱讀
- JavaScript百煉成仙
- ASP.NET MVC4框架揭秘
- Reactive Programming with Swift
- Web開發(fā)的貴族:ASP.NET 3.5+SQL Server 2008
- Oracle 12c中文版數(shù)據(jù)庫管理、應(yīng)用與開發(fā)實(shí)踐教程 (清華電腦學(xué)堂)
- PHP 編程從入門到實(shí)踐
- 云計(jì)算通俗講義(第3版)
- Salesforce Reporting and Dashboards
- Mastering ArcGIS Enterprise Administration
- CRYENGINE Game Development Blueprints
- Modern C++ Programming Cookbook
- 30天學(xué)通C#項(xiàng)目案例開發(fā)
- C++17 By Example
- SQL Server on Linux
- 高質(zhì)量程序設(shè)計(jì)指南:C++/C語言