K
Kirok
Hey Everyone,
Thanks for reading, heres what I'm trying to do I have an array of say 10
items each item contains the text / description for a room.
Now I would like to create a class (lets call it BookSection) this class
will display the text for the current room the user is in and then have
links to other rooms (left, right, east, west, etc) then dependant upon the
choice made by the user will move to the new room and display the text
I've come up with the following code and after searching the books I have
(Head First Java, Just Java 2 and How to Program Java) and checking online
I'm at a loss and was wondering if anyone had any idea how to code this
(based on the bad and very limited code I have below)
class booksection{
int index //page number
string text //the story
int[]choices // the pages links
}
to display a page the program would display the string and the choices
and then load the choice the user made
method getchoices(page, thispage){
string text = "choises are"
thispage.choices.length
for (int i=0; i<2, i++){
text = text+thispage.choice
}
return text
}
this would display the story and the appropriate choices
Any replies are greatly appreciated.
Thanks for reading, heres what I'm trying to do I have an array of say 10
items each item contains the text / description for a room.
Now I would like to create a class (lets call it BookSection) this class
will display the text for the current room the user is in and then have
links to other rooms (left, right, east, west, etc) then dependant upon the
choice made by the user will move to the new room and display the text
I've come up with the following code and after searching the books I have
(Head First Java, Just Java 2 and How to Program Java) and checking online
I'm at a loss and was wondering if anyone had any idea how to code this
(based on the bad and very limited code I have below)
class booksection{
int index //page number
string text //the story
int[]choices // the pages links
}
to display a page the program would display the string and the choices
and then load the choice the user made
method getchoices(page, thispage){
string text = "choises are"
thispage.choices.length
for (int i=0; i<2, i++){
text = text+thispage.choice
}
return text
}
this would display the story and the appropriate choices
Any replies are greatly appreciated.