Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Here are the details: The board is a 9 x 9 board. Use a list of lists to store your current board. Display the
Here are the details: The board is a 9 x 9 board. Use a list of lists to store your current board. Display the current state of the board before every move. Each empty point should just be a period. Each point with a stone should have that stone's identifier. For identifiers, you may use lower-case for the white stones and upper-case for the black stones. Use 0/o or distinct round symbols (*, @, , etc). For a fun alternative, see the note at the bottom. When a stone is placed, it must be placed on an empty point. Continue to let users place stones until they enter "stop". Important: You do NOT need to enforce any rules of Go or verify moves, with two exceptions: If a user tries to place a stone where one already exists, print a message to the screen and try again. Alternate turns with black placing the first stone. Other than that, you don't need to worry about placing stones on forbidden points, removing stones, determining a winner, etc. This is an open-ended assignment. Feel free to get creative with your output! You need to specify the system you want to use to identify the locations on the board. In your pdf document, include instructions for user input. This problem will be graded manually so your instructions must be clear. In Go a simple coordinate system similar to chess is used to identify points on the board. You do not have to use this system, but you can if you wish. Your pdf must include an algorithm and instructions for running your program. Part 2: Now that your team has planned everything, write a program named go_moves.py that sets up a Go board and lets users place stones. Remember to write test cases and use the "pyramid" approach to programming! As an example, here is what the board would look like in the middle of a game: ..O.. .000. .0000. ..oooo... ...00.... Remember to discuss this as a team and think through exactly what you will do before developing it! Note: You can display empty and filled circles using Unicode characters like the example below. print (chr (9675)) print (chr (9679)) #displays empty circle: 0 #displays filled circle: You can also change the color of your output using the colorama package like the example below. from colorama import Fore, Style print (Fore. RED + Style. BRIGHT + 'my text' +Fore.RESET+ Style. NORMAL) # displays 'my text' in bright red, then resets future text back # to default colors If you do not have colorama installed, you can use the following strings to do the same thing. begin = '\x1b [1m' end = '\x1b [39m\x1b [22m' colors = {'red': '\x1b [31m', 'blue': '\x1b [34m', 'green' : '\x1b [32m' } print (begin+colors ['red'] + 'red text'+end+back to normal') print (begin + colors ['blue'] + 'blue text' + end + back to normal'). print (begin + colors ['green'] + 'green text' + end + back to normal') 1
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Based on the details provided you are tasked with writing a program to simulate a Go board that fulf...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started