Jump to content

  • Log In with Google      Sign In   
  • Create Account

Awesome job so far everyone! Please give us your feedback on how our article efforts are going. We still need more finished articles for our May contest theme: Remake the Classics

TheScriptan

Member Since 21 Jan 2013
Offline Last Active Mar 31 2013 01:54 PM
-----

Topics I've Started

How to read file line

23 January 2013 - 06:06 AM

How can I read file line. For example I create file settings.dat and i want to store two lines in it, color id, and username. How do i need to do. I tried to google but it was not worth it. :(


Help with passing string

22 January 2013 - 08:41 AM

So i have made program that changes username nick in the main menu, but it wont work, here is the code

public void rUsername() 
    {
        string uInput;
        Console.WriteLine("Rename Your Username: ");
        uInput = Console.ReadLine();
        username = uInput;
        Console.Clear();
        Console.WriteLine("You changed your username succesfully! Press Enter To Continue...");
        Console.ReadLine();
        Console.Clear();
        initOptions();
    }

btw in class Options i have variable public string username; So what i want to do is just from this function pass it to the username that is in class, why it is not working (No Errors  btw)


How to handle this problem

21 January 2013 - 10:45 AM

For example I have this code:

Console.Write("Write Your First Number: ");
                num1 = int.Parse(Console.ReadLine()); // If i write here 6/2 or just s,y program frozes and exits. How To Handle that?
                Console.Write("Write Your Operand: ");
                operand = Console.ReadLine(); // If i write here 6/2 or just s,y program frozes and exits. How To handle that
                Console.Write("Write Your Second Number: ");
                num2 = int.Parse(Console.ReadLine()); // If i write here 6/2 or just s,y program frozes and exits. How To Handle That?
                switch (operand) 
                {
                    case "+":
                        answer = num1 + num2;
                        break;
                    case "-":
                        answer = num1 - num2;
                        break;
                    case "*":
                        answer = num1 * num2;
                        break;
                    case "/":
                        answer = num1 / num2;
                        break;
                    default:
                        Console.Clear();
                        Console.WriteLine("You entered wrong operand. Press Any Key To Continue...");
                        Console.ReadLine();
                        Console.Clear();
                        Calc();
                        break;
                }

How can i handle this if switch default is not working? It's just frozes. I just want to make Console.WriteLine("You entered wrong key, try again");


What games to create first?

21 January 2013 - 09:44 AM

I have a question, what games to create first in console?

I know that first one is Guessing numbers :D Please tell me more of them :)

 


How to create c# text based game like this

21 January 2013 - 07:51 AM

I was really confused when i tried to make so simple game, maybe im just out of ideas, here is what i want to make:

 

int input = 0; Console.WriteLine("You woke up in the island what you gonna do?");

Console.WriteLine("1. Go to city");

Console.WriteLine("2. Survive in wilderness");

input = Console.ReadLine();

if (input == 1) {How i need to go to the jumpspot?}()

if (input == 2) isDead = true; isDeadTrue();

 

jumpspot: How i need jump here to continue the game???

 

Console.WriteLine("You are in the city what you gonna do?");

Console.WriteLine("1. Search for food");

Console.WriteLine("2. Kill people");

if (input == 1) {jumpspot2:}()

if (input == 2) isDead = true; isDeadTrue();

jumpspot2:

and it goes on

 


PARTNERS