Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

C# C# Objects Loops and Final Touches Playing the Game

Many errors

In my workspace there are a couple of error I can't quite figure out how to fix them. I was wondering if someone could look at my workspace and tell me what I did wrong. ://w.trhou.se/ivh4llej3j

3 Answers

Steven Parker
Steven Parker
231,198 Points

It looks like all typo's.

All errors appear to be in Game.cs:

  • on line 30 there's a missing closing parentheses before the comma
  • on line 39 there's a missing semicolon at the end of the line
  • on line 48 "playerWon" (lower case "p") is misspelled as "PlayerWon" (capital "P")

These were easily found using the compiler error messages, which show you the module and line number to look on. Practice using these messages to locate your errors, and remember to check previous lines for omissions that might not be detected by the compiler until the next statement.

Thank you, but now when I run the program it tells me, Program.cs is a binary file and not a text file.

Steven Parker
Steven Parker
231,198 Points

What command did you enter when you got that message? Also please provide a fresh snapshot.

https://w.trhou.se/a3r8au4ay4

I typed in mcs -out:TreehouseDefense.exe *.cs && mono TreehouseDefense.exe

https://w.trhou.se/a3r8au4ay4

I typed in mcs -out:TreehouseDefense.exe *.cs && mono TreehouseDefense.exe

Steven Parker
Steven Parker
231,198 Points

I see that you created a new question for this issue so I answered it there.