Anyone pretty fluent with coding language? Need some assistance on a tic tac toe game?
In this assignment you will be writing a console C# program to conduct a game of Tic-Tac-Toe
between two players. The problem flow will be as follows:
1. Ask name of player 1
2. Ask name of player 2
3. Display the current state of the tic-tac-toe board and then ask player 1 to enter the row
and column she wants to play
4. After taking the entry from player 1, the position played by player 1 should be updated
with ‘0’, and the board should be displayed again
5. Ask player 2 to enter the row and column he wants to play
6. Keep repeating steps 3,4,5 till one of the player wins or the name is drawn
7. If one player wins display his/her name along with a message should say they have won.
If the game is drawn a message should display
8. You program should have the logic to determine when game is drawn and when a player
windows
9. The ‘*’ character should be used to denote and empty slot in the board while ‘0’ and ‘X’
should represent moves played by player’s 1 and 2 respectively.
This is pretty easy, what exactly are you stuck on ?
honestly, pretty much everything. this is my first C++ class and i am learning as i go, but this assignment has me stuck. I know how to ask for the name of player 1 and 2. But idk the logic to build the tic tac toe board. I guess for the other steps is a combo of "if and else loops"?
have you worked with arrays and 2D arrays in your class yet
this is an array correct?
int a 5 = {0;1;2;3;4};
im not sure about a 2d array. i missed like 2 classes because i came down with the flu so i missed a lot of the basic logic
@ChinchillaBrah Here’s some code I found on Chegg that may be able to help you out. You’ll have to type and indent everything yourself though; the pictures are in order.
—————————————
What do you need help with. Not trynna do the entire assignment for you but if you have questions I can def help..
string p1;
string p2;
cout << "Enter player 1 name: ";
cin >> p1;
cout << "Enter player 2 name: ";
cin >> p2;
That's 1 & 2 for you.
@ChinchillaBrah Here’s some code I found on Chegg that may be able to help you out. You’ll have to type and indent everything yourself though; the pictures are in order.
—————————————
real man, appreciate this
What do you need help with. Not trynna do the entire assignment for you but if you have questions I can def help..
string p1;
string p2;
cout << "Enter player 1 name: ";
cin >> p1;
cout << "Enter player 2 name: ";
cin >> p2;
That's 1 & 2 for you.
bet ima try this also. thanks man
If you have a specific question go for it, I’m a CS masters student + worked as a dev for a year
you say c++ but you say your doing it in c#?
make up ya damn mind.
C# playa my bad
This is what I have so far. Now I need to get the entry of each player to display on my game board. Would the player entry go inside the Main or do I create a new public argument?
https://imgur.com/a/PqEqi3H
This is what I have so far. Now I need to get the entry of each player to display on my game board. Would the player entry go inside the Main or do I create a new public argument?
Can’t see s*** in the screenshot but for getting player input you should decide how you’re gonna get the input (like how a player will indicate what space they’re picking to your program) and how you’re gonna store that input. Then make a function that gets the input from the user and returns whatever type you want to store it as. Then when you need their input call that function