-
Notifications
You must be signed in to change notification settings - Fork 1
/
dominos_prelim.txt
40 lines (29 loc) · 953 Bytes
/
dominos_prelim.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
Dominos
enter_starting_domino()
- Enter the starting domino
enter_hand()
- Enter domino separated by comma
- Enter nothing to finish
- Check each domino input
- Check for duplicate dominoes in the hand
- Return array of dominos
calculate_routes()
- Returns an array of arrays of dominos. Example:
[
[
[3,4],[4,12],[12,2]
]
]
- An array of dominos is a possible route
prioritize_routes()
- Takes in the array of routes
- Prioritizes the routes based on which one has the most domino dots
- Sends the best route to print_route()
print_route()
- Prints a route (an array of dominos).
Global Variables
- hand: array of dominos that was set by enter_hand()
Data Structures:
- Domino: Array of 2 integers, where 0 represents blank dots.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ LATER VERSION ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- Doubles are counted with a subsequent domino to count one turn