Register for your free account! | Forgot your password?

You last visited: Today at 09:21

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Tic Tac Toe

Discussion on Tic Tac Toe within the .NET Languages forum part of the Coders Den category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Jun 2013
Posts: 8
Received Thanks: 0
Tic Tac Toe

Hey noobs,

here is my new Tic Tac Toe Game.
Downloads: ca. 50 !

Download:
VirusTotal:

I will add a Screen soon.

Have fun !
BloodWork. is offline  
Old 08/06/2013, 00:09   #2
 
Ludder231's Avatar
 
elite*gold: 0
Join Date: Aug 2010
Posts: 880
Received Thanks: 113
Thats should be in the "Release" section. And you are the only "noob" here. Everybody can code a Tic Tac Toe
Ludder231 is offline  
Thanks
1 User
Old 08/06/2013, 03:23   #3
 
elite*gold: 100
Join Date: Aug 2005
Posts: 595
Received Thanks: 208
Noobs .. realy man ?

Ok ..

1. Name your stuff properly



2.

Example Code:

Code:
 private void Button6_Click(object sender, EventArgs e)
    {
      if (Operators.CompareString(this.Label2.Text, "X", false) == 0)
      {
        this.Button6.Text = "X";
        this.Label2.Text = "0";
      }
      else
      {
        this.Button6.Text = "0";
        this.Label2.Text = "X";
      }
      this.win();
      this.Button6.Enabled = false;
    }

    private void Button7_Click(object sender, EventArgs e)
    {
      if (Operators.CompareString(this.Label2.Text, "X", false) == 0)
      {
        this.Button7.Text = "X";
        this.Label2.Text = "0";
      }
      else
      {
        this.Button7.Text = "0";
        this.Label2.Text = "X";
      }
      this.win();
      this.Button7.Enabled = false;

etc...
    }
The same code over and over again is bad style and a pain for maintaining, your Task, think about a way to solve this

3.

Example Code:

Code:
 if (Operators.CompareString(this.Button1.Text, "X", false) == 0 & Operators.CompareString(this.Button2.Text, "X", false) == 0 & Operators.CompareString(this.Button3.Text, "X", false) == 0)
      {
        this.Label2.Text = "X wins";
        this.Button1.Enabled = false;
        this.Button2.Enabled = false;
        this.Button3.Enabled = false;
        this.Button4.Enabled = false;
        this.Button5.Enabled = false;
        this.Button6.Enabled = false;
        this.Button7.Enabled = false;
        this.Button8.Enabled = false;
        this.Button9.Enabled = false;
      }
      if (Operators.CompareString(this.Button4.Text, "X", false) == 0 & Operators.CompareString(this.Button5.Text, "X", false) == 0 & Operators.CompareString(this.Button6.Text, "X", false) == 0)
      {
        this.Label2.Text = "X wins";
        this.Button1.Enabled = false;
        this.Button2.Enabled = false;
        this.Button3.Enabled = false;
        this.Button4.Enabled = false;
        this.Button5.Enabled = false;
        this.Button6.Enabled = false;
        this.Button7.Enabled = false;
        this.Button8.Enabled = false;
        this.Button9.Enabled = false;
      }

etc ..
Same again, think about an algorithm which is able to calculate who is the winner.
dready is offline  
Thanks
1 User
Old 08/06/2013, 10:32   #4
 
elite*gold: 0
The Black Market: 134/0/2
Join Date: Dec 2012
Posts: 1,140
Received Thanks: 229
Quote:
Originally Posted by dready View Post
Noobs .. realy man ?

Ok ..

1. Name your stuff properly



2.

Example Code:

Code:
 private void Button6_Click(object sender, EventArgs e)
    {
      if (Operators.CompareString(this.Label2.Text, "X", false) == 0)
      {
        this.Button6.Text = "X";
        this.Label2.Text = "0";
      }
      else
      {
        this.Button6.Text = "0";
        this.Label2.Text = "X";
      }
      this.win();
      this.Button6.Enabled = false;
    }

    private void Button7_Click(object sender, EventArgs e)
    {
      if (Operators.CompareString(this.Label2.Text, "X", false) == 0)
      {
        this.Button7.Text = "X";
        this.Label2.Text = "0";
      }
      else
      {
        this.Button7.Text = "0";
        this.Label2.Text = "X";
      }
      this.win();
      this.Button7.Enabled = false;

etc...
    }
The same code over and over again is bad style and a pain for maintaining, your Task, think about a way to solve this

3.

Example Code:

Code:
 if (Operators.CompareString(this.Button1.Text, "X", false) == 0 & Operators.CompareString(this.Button2.Text, "X", false) == 0 & Operators.CompareString(this.Button3.Text, "X", false) == 0)
      {
        this.Label2.Text = "X wins";
        this.Button1.Enabled = false;
        this.Button2.Enabled = false;
        this.Button3.Enabled = false;
        this.Button4.Enabled = false;
        this.Button5.Enabled = false;
        this.Button6.Enabled = false;
        this.Button7.Enabled = false;
        this.Button8.Enabled = false;
        this.Button9.Enabled = false;
      }
      if (Operators.CompareString(this.Button4.Text, "X", false) == 0 & Operators.CompareString(this.Button5.Text, "X", false) == 0 & Operators.CompareString(this.Button6.Text, "X", false) == 0)
      {
        this.Label2.Text = "X wins";
        this.Button1.Enabled = false;
        this.Button2.Enabled = false;
        this.Button3.Enabled = false;
        this.Button4.Enabled = false;
        this.Button5.Enabled = false;
        this.Button6.Enabled = false;
        this.Button7.Enabled = false;
        this.Button8.Enabled = false;
        this.Button9.Enabled = false;
      }

etc ..
Same again, think about an algorithm which is able to calculate who is the winner.
Whats that shitty code?
Never heard from arrays/GDI+?
Acin™ is offline  
Reply




All times are GMT +1. The time now is 09:22.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2026 elitepvpers All Rights Reserved.