Jump to content

need help finishing tic tac toe windows form.

- - - - -

  • Please log in to reply
1 reply to this topic

#1
aaron4osu

aaron4osu

    Newbie

  • Members
  • Pip
  • 1 posts
For an assignment I had to create a windows form tic tac toe game with C# and visual studio 2010. I needs to be able to run off the command line, which I know little about. Pretty much everything is working except for a few things.

1)my new game button(button12). I can't figure out how to reset the board to start a new game. I've tried using InitializeComponent(); and a few other things without success.

2) I'm not sure if I need a main method or not. When I uncomment it I get errors. It works in visual studio commented out but i don't think it will work without it from the command line.

3) how do I run it from the mac terminal command line. Right now I have just been playing it from visual studio 10 using bootcamp. Do I put the entire folder in the bin(where I access my apps from?) I really need help on this part. I have not used the command line much and we don't cover it in class.

3) finally this is not part of the assignment requirements but I wanted to replace the "X" and "O" with images. Right now I represent an X or O as a string using the .Text attribute. I want to replace the strings with images using the background image attribute. I have the images as .jpg in the folder with all files. (OSU_helmet.jpg and michigan_helmet.jpg)

Attached Files



#2
Davide

Davide

    Programming God

  • Members
  • PipPipPipPipPipPipPip
  • 506 posts
I don't think they were talking about the Mac terminal, but about the Windows command prompt.
Run cmd.exe on Windows, it will open the command prompt:
Type dir to see the contents of the current directory, cd directory_name to go to that directory, and to run an application just type it's name.
Your application HAS a main method already, it's called the entry point because it's the first function that runs when you open the application. You can find your main function in Program.cs.

As for the images, add them to your resources and do the following to change them:
button1.Image = Project_Name.Resources.Default.Image_Name;

Ask if you have any more questions.
Are you a newbie programmer trying to learn C#? Check out my small tutorial: Visual C# Programming Basics




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users