Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
U

User 9432280

@User 9432280
About
Posts
1
Topics
1
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • tic toe game not working as expected,please help?
    U User 9432280

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.IO;
    using System.Threading;

    namespace tictoegame
    {

    public class gamestart
    {
        int functionalcount, computernumber,usernumber;
        char\[\] box = new char\[9\];
        static int j=6;
        public gamestart()
        {
    
            
            for(int k=0;k<9;k++)
            {
                box\[k\] = ' ';
            }
            functionalcount = 0;
            Random rd = new Random();
    
          while(true)
          {
                computernumber = rd.Next(0, 8);
                if (box\[computernumber\]!='x'&& box\[computernumber\]!='X'&&box\[computernumber\]!='o'&& box\[computernumber\]!='O')
                {
                    insertvalue(computernumber,Program.computersymbol);
                    break;
                    
                }
          }
            
            functionalcount++;
            userturn();
        }
        public void position()
        {
            int i=1;
            Console.CursorLeft=i;
            Console.CursorTop=j;
            j++;
        }
        public void userturn()
        {
    
            if (functionalcount != 9)
            {
                bool flag1 = checkwin(Program.usersymbol);
                if (flag1)
                {
                    position();
                    Console.WriteLine("you won");
                    Thread.Sleep(3000);
                    Environment.Exit(0);
                }
                else
                {
                    while (true)
                    {
                        position();
                        Console.WriteLine("enter the number for symbol");
                        usernumber = Convert.ToInt32(Console.ReadLine());
                        if (box\[usernumber\] != 'x' || box\[usernumber\] != 'X' && box\[usernumber\] != 'o' || box\[usernumber\] != 'O')
                        {
                            insertvalue(usernumber, Program.usersymbol);
                            functionalcount++;
                            break;
                        }
                    }
                    computerturn();
    
                }
    
            }
        }
        public void computerturn()
        {
            int count=0,i;
            if (functionalcount == 2)
            {
                Random rd = new Random();
                while (true)
                {
                    com
    
    C# csharp linq com game-dev help
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups