I am currently using c# 2010 to do a sort of sim person.he eats, exercises, checks health level, ect. but its not graphic. But I cant find whats not working here is the code the first one is the main program the second one is using a class for access modifiers.Thank you.p
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ConsoleApplication1;
namespace critter
{
class Program
{
static void Main(string[] args)
{
human select=new human();
while (true)
{
select.Health();
Console.WriteLine("(1) health level");
Console.WriteLine("(2) tiredness level");
Console.WriteLine("(3) hungriness level");
Console.WriteLine("(4) sleep");
Console.WriteLine("(5) eat");
Console.WriteLine("(6) exercise");
Console.WriteLine("(7) exit");
Console.Read();
1
Expert's answer
2012-12-19T11:18:07-0500
You must check the entered value. For example: ... Console.WriteLine("(7) exit"); int x = Console.Read(); char ch = Convert.ToChar(x); if (ch == '7') break; ...
Comments
Leave a comment