Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Changing Code

  • 15-01-2008 7:20pm
    #1
    Registered Users, Registered Users 2 Posts: 325 ✭✭


    Hi

    I have a project that involves the game TIC TAC TOE.

    It needs to be designed using ASP.NET web forms and C#.

    The question I have is that I have the code I need, its in C#, but its designed as a project instead of a website in Visual Studios.

    Can someone tell me how hard it is to change this to the required web forms? Is it hard or is there an easy way to do it?

    Cheers


Comments

  • Registered Users, Registered Users 2 Posts: 981 ✭✭✭fasty


    It depends on how the code was done. If the programmer separated display code from the actual game logic, it might be easy enough but if not, there could be more work involved.


  • Users Awaiting Email Confirmation Posts: 351 ✭✭ron_darrell


    With the greatest of respect to the OP, the logic behind Tic-tac-toe is not difficult. It would be far better for him/her to write the code themselves than attempt to adapt exsting code to a webform.

    The logic can be broken down in 3 parts:
    • What do we do when the user clicks on a square? (i.e. how to set which players move it is, which square belongs to which player, has the square already been taken, has the game begun, is the game over?)
    • How to decide if the clicking of that square has won the game (the simplest method of doing this is a brute force check i.e. check first row, check second row, check third row, check first column, check second column, check third column, check right diagonal, check left diagonal)
    • How to display a winner and set the game in neutral ready for a new game (i.e. either disable clicking on the squares or the act of clicking on the squares offers the user the option of restarting the game)

    There are many tutorials on ASP.Net through C# available online (there's a reasonable one at http://www.w3schools.com/ and a very in depth one on the http://msdn.microsoft.com/ I think writing from scratch would be the best option in terms of getting a handle on ASP.Net and C# for you.

    -RD


Advertisement