#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2013
    Posts
    6
    Rep Power
    0

    Help with Tic Tac Toe game !!!


    Hello guys,
    i have file that has html of the game and i must not change anything in it.
    i have to make external javascript file for game.
    so if anyone can help ?!
    the code is ::
    Code:
    <html>
        <head>
            <title>Tic Tac Toe</title>
            <style>
                td {
                    border-width: 2px;
                    border-style: solid;
                    border-color: black;
                    border-collapse: collapse;
                    padding: 5px;
                    width: 2em;
                    text-align: center;
                    cursor: pointer;
                }
    
                td.winner {
                    background: red;
                }
            </style>
        </head>
        <body>
            <center>
                <h1>Tic Tac Toe</h1>
                <table>
                    <tr id="row1">
                        <td id="square00">&nbsp;</td>
                        <td id="square10">&nbsp;</td>
                        <td id="square20">&nbsp;</td>
                    </tr>
                    <tr id="row2">
                        <td id="square01">&nbsp;</td>
                        <td id="square11">&nbsp;</td>
                        <td id="square21">&nbsp;</td>
                    </tr>
                    <tr id="row3">
                        <td id="square02">&nbsp;</td>
                        <td id="square12">&nbsp;</td>
                        <td id="square22">&nbsp;</td>
                    </tr>
                </table>
            </center>
            <script type="text/javascript" src="tictactoe.js"></script>
        </body>
    </html>
  2. #2
  3. Lord of the Dance
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Oct 2003
    Posts
    3,581
    Rep Power
    1906
    Do you know how to play tic-tac-toe?
    What do you know about JavaScript?

    You have to ask more specific what you need help.

    As a starting hint, you can look at the onclick function to allow the user to "select a field on the game board".
  4. #3
  5. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2013
    Location
    Saint-Petersburg, Russia
    Posts
    236
    Rep Power
    28
    Well, you may look the implementation in javascript on this page:

    http://codeabbey.com/index/task_view/tic-tac-toe

    (just use Ctrl-U)

    Though this is intentionally stylized as "console emulator"
    CodeAbbey - programming problems for novice coders
  6. #4
  7. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2013
    Posts
    6
    Rep Power
    0
    Thanks for replying,
    my problem is that i can't change anything in html file
    And i need to make (form) in html to use it in javascript .
    I don't know what to do?!
    My deadline is tomorrow.

IMN logo majestic logo threadwatch logo seochat tools logo