1
+ """Carrot in a Box, Alsweigart al@invent with python.com
2
+ A silly bluffing game between two human players. Based on the game
3
+ from the show 8 Out of 10 Cats.
4
+ View this code at https://nostarch.com/big-book-small-python-projects
5
+ Tags: large beginner, game, two-player"""
6
+
7
+ import random
8
+
9
+ print (
'''Carrot in a Box, by Al Sweigart [email protected]
10
+
11
+ This is a bluffing game for two human players. Each player has a box.
12
+ One box has a carrot in it. To win, you must have the box with the
13
+ carrot in it.
14
+
15
+ This is a very simple and silly game.
16
+
17
+ The first player lok into their box (the second player must close
18
+ their eye during this). The first player then says "There is a carrot
19
+ in my box" or "There is not a carrot in my box". The second player then
20
+ gets to decide if theu want to swap boxes or not.
21
+ ''' )
22
+ input ('Press Enter to begin...' )
23
+
24
+
25
+ p1Name = input ('Human player 1, enter your name: ' )
26
+ p2Name = input ('Human player2, enter your name: ' )
27
+ playerNames = p1Name [:11 ].center (11 ) + ' ' + p2Name [:11 ].center (11 )
28
+
29
+ print (''' HERE ARE TWO BOXES:
30
+
31
+ +--------------+ +--------------+
32
+ /| /| /| /|
33
+ / | / | / | / |
34
+ *--+-----------* | *--+-----------* |
35
+ | | | | | | | |
36
+ | | | | | | | |
37
+ | | | | | | | |
38
+ | +-----------+--+ | +-----------+--+
39
+ | / | / | / | /
40
+ |/ |/ |/ |/
41
+ *--------------* *--------------*
42
+
43
+ ''' )
0 commit comments