C
C#2y ago
hills

❔ Fixing some methods

Working on a game for my course right now. There are two methods that i need to fix: PlayGame and DisplayState. As it stands the game allows each player to accept an unlimited number of offer moves and swap them into their move queue. The offer move is displayed at the start of the turn. If the offer move is accepted and swapped into the queue: - I need to make sure another offer move is NOT displayed. - The prompt "…or 9 to take the offer: " should be hidden, so that only "Choose move option to use from queue (1 to 3)" is displayed - When the player's turn is complete, an offer move and all prompts should be displayed for the other player. Any help would be massively appreciated
8 Replies
hills
hills2y ago
hills
hills2y ago
Anton
Anton2y ago
$code
MODiX
MODiX2y ago
To post C# code type the following: ```cs // code here ``` Get an example by typing $codegif in chat If your code is too long, post it to: https://paste.mod.gg/
hills
hills2y ago
PlayGame Method https://paste.mod.gg/wtlncwgjnhmy/0 DisplayState Method
private void DisplayState()
{
DisplayBoard();
Console.WriteLine("Move option offer: " + MoveOptionOffer[MoveOptionOfferPosition]);
Console.WriteLine();
Console.WriteLine(CurrentPlayer.GetPlayerStateAsString());
Console.WriteLine("Turn: " + CurrentPlayer.GetName());
Console.WriteLine();
}
private void DisplayState()
{
DisplayBoard();
Console.WriteLine("Move option offer: " + MoveOptionOffer[MoveOptionOfferPosition]);
Console.WriteLine();
Console.WriteLine(CurrentPlayer.GetPlayerStateAsString());
Console.WriteLine("Turn: " + CurrentPlayer.GetName());
Console.WriteLine();
}
BlazeBin - wtlncwgjnhmy
A tool for sharing your source code with the world!
Anu6is
Anu6is2y ago
what's your actual question though?
hills
hills2y ago
the bullet points i need to alter the code so it meets those conditions im not even exactly sure how to go about tht
Accord
Accord2y ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server
More Posts
❔ i don't know how to start.Hi, I am a complete beginner, I don't know how to start nor where to start. What should I do, also d❔ Visual Studio Installer Projects not workingI tried to use Visual Studio Installer Projects and when I built the project and installed it, Micro❔ Return gets ignored for some godforsaken reasonDespite the `if (cb is null) return NotFound();` the code progresses further, and causes an unhandle✅ [RESOLVED]It seems that my variables is destroyed after the Awake()Hello, I’m trying to accessing a variable from another script with a singleton. When I debug the var❔ ✅ gettext amount always Underlined as red and not working in the codegettext amount are always Underlined as red and not working in my ui CodecodeUnresolved NuGet Dependency ReferencesI have XUnit added as a dependency to my test project via NuGet. Despite this, my test project code ❔ UNITY Code only fully executes after running it another timeWhen running GenerateCities() it only does DestroyCities() and CreateCountryColors() before stopping✅ Recieve less than transmitting in network streamHello there, I'm trying to implement a FTP server and I got troubles with the network stream Whenevedouble.Parse(3.5).ToString() returns 35I got confused troubleshooting since web results didnt help, so i asked chatgpt and his code snippet❔ How could I make my console app not close when it's double clicked in explorer?my console app is directed towards beginners (supposed to work alongside an existing app, which is a