Overclock.net - Overclocking.net
     
 
Home Gallery Reviews Blogs Register Today's Posts Mark Forums Read Members List


Go Back   Overclock.net - Overclocking.net > Software, Programming and Coding > Coding and Programming

Reply
 
LinkBack Thread Tools
Old 4 Weeks Ago   #1 (permalink)
New to Overclock.net
 
Jamar16's Avatar
 
amd ati

Join Date: Jan 2009
Location: Jamaica
Posts: 479

Rep: 42 Jamar16 is acknowledged by some
Unique Rep: 40
Hardware Reviews: 4
Trader Rating: 0
Default Please delete, question solved

Was going thru sum programming papers and saw this, so need some tips on how to write it

In the kids game “Paper, Rock, Scissors”, each player chooses one of the three and the winner is determined by the relationship between the two choices. “Paper covers rock”, so paper wins, “rock breaks scissors”, so rock wins; and “scissors cuts paper”, so scissors wins. If both choose the same, it is a tie and no one wins.

Requirements.

a) Write a function MachineChoice that returns a character for the choice of (p)aper, (r)ock or (s)cissors.
b) Write a function PlayGame that will accept three parameters; the machine’s choice, the player’s choice and the score. This function should also return the score.
c) Write a program to play the game against the computer until the player enters q to quit.

Sample Output.
Choose (p)aper, (r)ock, (s)cissors or (q) uit: p
The machine chooses scissors. YOU LOSE! Your score -1
Choose (p)aper, (r)ock, (s)cissors or (q) uit: s
The machine chooses scissors. IT’S A TIE! Your score -1
Choose (p)aper, (r)ock, (s)cissors or (q) uit: p
The machine chooses rock. YOU WIN! Your score 0
Choose (p)aper, (r)ock, (s)cissors or (q) uit: p
The machine chooses rock. YOU WIN! Your score 1
Choose (p)aper, (r)ock, (s)cissors or (q) uit: q

THANK YOU FOR PLAYING WITH ME …..
__________________
WE HAVE THE 100M AND 200M RECORDS!!!! 9.58 AND 19.19 TOP THAT!!!!!
Offical Member of the AM2/AM2+ Club
PhenomIsts
GPU Validation Core 860mhz, Memory 1120mhz
Highest overclock3.4Ghz

3.324ghz

System: 9950
CPU
Phenom 9950 @ 3.2GHz
Motherboard
Asus M3A78-T
Memory
G. Skill 4GB 1104MHZ
Graphics Card
HIS 1GB 4870
Hard Drive
Western Digital 640GB
Power Supply
Neopower 550W
Case
Antec 300
CPU cooling
Zalman 9700NT
GPU cooling
Stock
OS
Windows 7 x64
Monitor
Toshiba Theather Wide HD 19"

Last edited by Jamar16 : 4 Weeks Ago at 01:00 PM
Jamar16 is offline   Reply With Quote
Old 4 Weeks Ago   #2 (permalink)
4.0 GHz
 
dharmaBum's Avatar
 
intel nvidia

Join Date: Apr 2007
Location: Raleigh, NC
Posts: 747

Rep: 121 dharmaBum is acknowledged by manydharmaBum is acknowledged by many
Unique Rep: 89
Trader Rating: 0
Default

I'm not sure copy-pasting the assignment verbatim is the tactful way of going about things.
__________________
3DMark06: 19091 - 3DMark Vantage: P15264 - SuperPi: 10.968s

Programming Quote of the Day:
Bjarne Stroustrup:
Quote:
There are only two industries that refer to their customers as ‘users’.

System: Europa
CPU
E8500 4.36ghz @ 1.36v
Motherboard
EVGA 780i SLi P05 Bios
Memory
G.SKILL 4GB(2x2GB) @ 924MHz (5-4-4-12-2T)
Graphics Card
2xEVGA 8800GTS (G92) 512MB @800/2000/2110
Hard Drive
Seagate 500gbx2, (fake-)RAID0
Sound Card
Sound Blaster X-Fi XtremeGamer
Power Supply
CORSAIR 1000HX 1000W
Case
Gigabyte GZ-FA2CA-AJB Black Aluminum
CPU cooling
TDX 775 Block, 360 BlackIce rad
GPU cooling
MAZE5x2, TT copper HS
OS
Fedora10-86_64/Vista64
Monitor
22" Samsung SyncMaster 2232BW
dharmaBum is offline   Reply With Quote
Old 4 Weeks Ago   #3 (permalink)
New to Overclock.net
 
Jamar16's Avatar
 
amd ati

Join Date: Jan 2009
Location: Jamaica
Posts: 479

Rep: 42 Jamar16 is acknowledged by some
Unique Rep: 40
Hardware Reviews: 4
Trader Rating: 0
Default

not an assignment, just going thru sum papers and i saw this one, just wanted tips
__________________
WE HAVE THE 100M AND 200M RECORDS!!!! 9.58 AND 19.19 TOP THAT!!!!!
Offical Member of the AM2/AM2+ Club
PhenomIsts
GPU Validation Core 860mhz, Memory 1120mhz
Highest overclock3.4Ghz

3.324ghz

System: 9950
CPU
Phenom 9950 @ 3.2GHz
Motherboard
Asus M3A78-T
Memory
G. Skill 4GB 1104MHZ
Graphics Card
HIS 1GB 4870
Hard Drive
Western Digital 640GB
Power Supply
Neopower 550W
Case
Antec 300
CPU cooling
Zalman 9700NT
GPU cooling
Stock
OS
Windows 7 x64
Monitor
Toshiba Theather Wide HD 19"
Jamar16 is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools



All times are GMT -5. The time now is 02:59 AM.


Overclock.net is a Carbon Neutral Site Creative Commons License

Terms of Service / Forum Rules | Privacy Policy | DMCA Info | Advertising | Become an Official Vendor
Copyright © 2009 Shogun Interactive Development. Most rights reserved.
Page generated in 0.12440 seconds with 8 queries