Help me w/ this piece of code.

Started by
16 comments, last by craphead 21 years, 4 months ago
im trying to make my first game. its an interactive text game or "text adventure". but it wont compile. heres the code:
#include <iostream.h>

int main()

{                 

  for(int N=0;N<100;N++) 

  
int YorN;

  cout<<"You are in a dark forest.";
     
  cout<<"Ahead of you lies a path.";
  
  cout<<"Do you wish to go on?";
  
  cout<<"Y or N";

  cin>>YorN;

  cout<<"You chose :"< 

Tell me what ya think.

[edited by - craphead on November 26, 2002 3:12:15 PM]

[edited by - craphead on November 26, 2002 3:24:16 PM]    
50/50 Robotics and Software
Advertisement
the site screwed up my code
50/50 Robotics and Software
Put code tags around it, or souce tags. without the spaces.

Billy - BillyB@mrsnj.com
ok

#include <iostream.h>int main(){                   for(int N=0;N<100;N++)   int YorN;  cout<<"You are in a dark forest.";       cout<<"Ahead of you lies a path.";    cout<<"Do you wish to go on?";    cout<<"Y or N";  cin>>YorN;  cout<<"You chose :"<  {			 			         cout< }            return 0;}   


[edited by - craphead on November 26, 2002 3:26:39 PM]

SCREW THIS ILL FIGURE IT OUT!

[edited by - craphead on November 26, 2002 3:28:02 PM]
50/50 Robotics and Software
WTF!
50/50 Robotics and Software
quote:Original post by craphead
im trying to make my first game. its an interactive text game or "text adventure". but it wont compile.

heres the code:

#include <iostream.h>int main(){                   for(int N=0;N<100;N++)   int YorN;  cout<<"You are in a dark forest.";       cout<<"Ahead of you lies a path.";    cout<<"Do you wish to go on?";    cout<<"Y or N";  cin>>YorN;  cout<<"You chose :"<  {  



cout<
}


return 0;

}

Tell me what ya think.

[edited by - craphead on November 26, 2002 3:12:15 PM]


You might want to repost this w/o the triple *figuratively speaking, but u only need 1 pair* code tags

quote:"I hate you so much right now!"
-Crawling Demo by Linkin Park
I think maybe you should delete your previous posts then put your code in between
     [source] and   
and [/source] tags.

[edited by - com on November 26, 2002 3:24:53 PM]
You should see the FAQ, it''s easy.

[ source]
int main()
{
for( int i=0; i<100; i++ )
{
// bla bla bla
}
}
[ /source]

Kamikaze


  #include <iostream>using namespace std;//use this header and namespace above. //C++ standard, iostream.h is depreciated (ie: not used)int main(){                   for(int N=0;N<100;N++)   {char YorN; // if they''re printing a letter, use char cout<<"You are in a dark forest."<< endl;       cout<<"Ahead of you lies a path."<< endl;    cout<<"Do you wish to go on?"<< endl;    cout<<"Y or N";  cin>>YorN;  cout<<"You chose : "<< YorN;  }return 0;}   

Beginner in Game Development?  Read here. And read here.

 

Im well past that. Im almost done w/ the game!
50/50 Robotics and Software

This topic is closed to new replies.

Advertisement