![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| A program to trace execution of another program | jiten_hegde | High Level Programming | 3 | 08-19-2008 02:26 AM |
| How to write to stdin of another program (program A -> [stdin]program B) | vvaidyan | UNIX for Dummies Questions & Answers | 3 | 08-02-2008 02:21 PM |
| How to write to stdin of another program (program A -> [stdin]program B) | vvaidyan | High Level Programming | 1 | 04-30-2008 10:44 AM |
| executing a program within a program | Gekko | High Level Programming | 4 | 06-27-2002 12:36 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
a dice program........
having difficulty with this
please help with code if anyone can. ____________________________________ Write a script that plays a ‘double or nothing’ game. The rules are: a bet is laid and the dice is rolled. If it’s an even number you win double the bet. If it's odd you lose the lot. The program should allow the user to play as many times as they like. Make sure you keep the user informed all the time as to how much they are winning/losing. The dice roll can be done using the following code: Declare an integer variable called dice. typeset –i dice and in the code: ((dice=RANDOM%6+1)) This assigns to dice a random number value between 1 and 6 inclusive. |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
Thread closed due to violation of the "No Homework" rule.
|
||||
| Google The UNIX and Linux Forums |