Previous Thread
Next Thread
Print Thread
Rate Thread
#101874 12/30/2000 11:35 AM
Joined: Sep 2000
Posts: 138
Em8 Offline
Member
Member
Offline
Joined: Sep 2000
Posts: 138
A C(or C++) Rock, Paper, Scissors game that I could put into my compiler? So it would run in a DOS window.

------------------

Sponsored Links
#101875 01/05/2001 7:50 PM
Joined: May 2000
Posts: 243
Member
Member
Offline
Joined: May 2000
Posts: 243
I once found one that was javascript. I must say it was really fun [Linked Image]

but sorry dont know where you could find one of those

------------------
Powered by ZCom Bulletin Boards

#101876 01/05/2001 11:59 PM
Joined: Aug 2000
Posts: 3,590
Moderator
Moderator
Offline
Joined: Aug 2000
Posts: 3,590
why not a perl script?

------------------


:: Who is Andy?

#101877 01/06/2001 10:00 AM
Joined: Sep 2000
Posts: 138
Em8 Offline
Member
Member
Offline
Joined: Sep 2000
Posts: 138
I made one, but it says a C/C++ compiler and Apache screws up my computer, and I don't want it on the internet (because of the connection).

------------------


This message has been edited by Em8 on January 06, 2001 at 07:59 PM

#101878 01/06/2001 12:29 PM
Joined: Aug 2000
Posts: 3,590
Moderator
Moderator
Offline
Joined: Aug 2000
Posts: 3,590
Perl can be run via command line as well -- its not only for the web...

------------------


:: Who is Andy?

Sponsored Links
#101879 01/06/2001 7:32 PM
Joined: Sep 2000
Posts: 138
Em8 Offline
Member
Member
Offline
Joined: Sep 2000
Posts: 138
How?

------------------

#101880 01/06/2001 9:10 PM
Joined: Sep 2000
Posts: 138
Em8 Offline
Member
Member
Offline
Joined: Sep 2000
Posts: 138
And to make a rock paper scissors game wouldn't you:

1. Get the users input (I call this varible "you" in the example)

2. Get a random number

3. if the random number is 1 a varible equals rock, 2 paper, 3 scissors (I call this varible "me" in the example)

4. then like (or should I use cout?):
Code
code:

5. ask user for Y or N (I call this varible "yorn" in the example)

6. if "yorn" is Y then redo, if its N "return 0;", or if its other ask again

Or am I wrong?

------------------

#101881 01/06/2001 11:10 PM
Joined: Aug 2000
Posts: 3,590
Moderator
Moderator
Offline
Joined: Aug 2000
Posts: 3,590
Quote
quote:
The above should work, though untested. Save the file, navigate to the directory in MS DOS that it is in, and type "perl test.pl" where test.pl is the file name.

------------------


:: Who is Andy?


Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
Gizmo
Gizmo
Portland, OR, USA
Posts: 5,833
Joined: January 2000
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20221218)