Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6141349
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T18:14:20+00:00 2026-05-23T18:14:20+00:00

i was writing a program and using double.Try Parse to check if a string

  • 0

i was writing a program and using double.Try Parse to check if a string is numeric.

class Game{ // declares the class
    private static string[,] board = new string[3, 3]{
                                          {" ", " ", " "}, // top row
                                          {" ", " ", " "}, // middle row
                                          {" ", " ", " "}  // bottom row
                                      };


private static void print(){
    System.Console.WriteLine("\n {0} | {1} | {2} ", board[2, 0], board[2, 1], board[2, 2]);
    System.Console.WriteLine("------------");
    System.Console.WriteLine(" {0} | {1} | {2} ", board[1, 0], board[1, 1], board[1, 2]);
    System.Console.WriteLine("------------");
    System.Console.WriteLine(" {0} | {1} | {2} \n", board[0, 0], board[0, 1], board[0, 2]);
}

private static void calculateMoves(){
    System.Console.Write("The possible moves are: ");
    int n = 1; // this is used to list all possible moves.
    for (int i = 0; i < 3; i++){
        for (int j = 0; j < 3; j++){
            if (board[i, j] == " "){
                System.Console.Write("{0} ", n);
            }
            n++;
        }
    } // end print possible moves.
    System.Console.WriteLine(); // go to next line
}

public static bool isNumeric(string s){ // this functions checks if the input string is numeric.
    double Result;
    return double.TryParse(s, out Result);
}        

static void Main(){ 
// the main function, the program starts from (this is a method declartion)
    System.Console.WriteLine("\nWelcome to theelitenoob's simple tic tac toe game!");
    System.Console.WriteLine("Written in C#, released under the GPL.");
    System.Console.WriteLine("The board is 3 by 3, Type a number to place a move there.");
    System.Console.WriteLine("So 1 is bottom left and 9 is top right, like a standard keypad.\n");
    int winner = 0; // there is no winner yet.
    // write players piece
    System.Console.WriteLine("You are x");
    // create the board
    int move; // move number
    string input; // the string from which move number is got from
    while(winner == 0){
        print();
        calculateMoves();
        System.Console.Write("Please type in a move number: ");
        input = System.Console.ReadLine();
        if(!isNumeric(input)){ // check if input is *not* numeric
            // if it isn't, print message and ask for input again.
            System.Console.WriteLine("Thats not a valid move, Try again!");
            continue;
        }
        move = System.Convert.ToInt32(input);
        /**/
        if (move == 1 && board[0, 0] == " ")board[0, 0] = "x";
        if (move == 2 && board[0, 1] == " ")board[0, 1] = "x";
        if (move == 3 && board[0, 2] == " ")board[0, 2] = "x";
        if (move == 4 && board[1, 0] == " ")board[1, 0] = "x";
        if (move == 5 && board[1, 1] == " ")board[1, 1] = "x";
        if (move == 6 && board[1, 2] == " ")board[1, 2] = "x";
        if (move == 7 && board[2, 0] == " ")board[2, 0] = "x";
        if (move == 8 && board[2, 1] == " ")board[2, 1] = "x";
        if (move == 9 && board[2, 2] == " ")board[2, 2] = "x";
    } // end while loop
}

}

However. it shows me an error: whenever i try to compile, i went through all of msdn and searched google, but can’t figure out how to fix.

This is the error i get:

tictactoe.cs(33,23): error CS1501: No overload for method 'TryParse' takes '2' arguments

does anyone know why this happens and how to fix it?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T18:14:20+00:00Added an answer on May 23, 2026 at 6:14 pm

    The Double.TryParse Method has two overloads:

    • TryParse(String, NumberStyles, IFormatProvider, Double)

    • TryParse(String, Double)

    The former exists since .NET 1.1, while the latter was introduced in .NET 2.0.


    Mono ships with two compilers:

    • mcs — aims to implement the latest .NET version without generics (< .NET 2.0)

    • gmcs — aims to implement the latest .NET version with generics (>= .NET 2.0)

    So mcs doesn’t know about the new overload. It’s pretty outdated and afaik not actively maintained.

    Use gmcs for the latest C# and .NET version.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am writing a program using Delphi 2006 and storing data in XML files
I'm writing a program using C++ and the MySQL C API (version 5.1.31 ubuntu2).
I am writing an application program using swing. I need to exit from the
I tried writing a program in Java using regex to match a pattern and
I'm writing a program (for Mac OS X, using Objective-C) and I need to
I am writing a program that generates excel reports, currently using the Microsoft.Interop.Excel reference.
I am newbie at using DataSet. I am writing a program with VB.NET, there
I am writing a python program that lauches a subprocess (using Popen). I am
Writing a python program, and I came up with this error while using the
I'm writing a genetic program to perform symbolic regression on a formula. I'm using

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.