Got a project. No help, confused on how to do this.
I have a project that I have to get done by next Monday, and I am a novice in programming, and am confused on how to do this. Here is the exact project
Quote:
Originally Posted by
For this assignment, you will create an application that contains a collection of rooms. You will be able to move around to and from these rooms by typing in 'north', 'south', 'east', or 'west'.
In your Program.cs file, you will have an array of Room objects, and you will have an index that represents the current room. You will have a run loop which will collect input from the player. It will then send this input to the Room object in the list refered to by the current room, and it will give you a new room index that represents the room index in that particular direction. You will then set the new room index as the current room index, and print out the current room. You will also have to initialize at least 6 Room objects in the list.
You also must create a Room class. This room class will have 6 fields. Two strings to represent the room name and description, and then four integers, each the index of the room in a direction. It will have a constructor that takes arguments for all 6 variables, and then copys the values into its own fields. It will also have a method that takes a text input from the player. Based on this input, the method will return the index it has stored for the indicated direction. The Room class will also have an override for the ToString method, so that we can use it to print out the room. All it should do is attach the room name and description together in some form or another, and then return it.
So far I have been ignoring my Program.cs file and been working on my RoomClass.cs file. I am using Microsoft Visual Studio 2005 Express Edition. So far my entire code is
Quote:
Originally Posted by RoomClass.cs
using System;
using System.Collections.Generic;
using System.Text;
namespace NewProject21
{
class RoomClass
{
string MainRoom = "You are in the Main Room";
string MainRoomInfo = "You are in the Main Room. You can go North to the Hallway";
}
}