Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

2D All the way! / Text Adventures

Author
Message
DarkSith
21
Years of Service
User Offline
Joined: 8th Nov 2002
Location: United Kingdom
Posted: 15th Aug 2003 13:01
This might interest a few people.

I am working on a text adventure. I have been working from an Ian Livingstone book. The City of Thieves. All I need help on is the combat. You have some dice. I have been using rnd(6) or rnd(12) depending on the dice, 6 for 1 die and 12 for two dice.

I now have a battle coming up in the book. How would I code this?

Any help much appreciated.
"He will join us, or die my Master..." - Darth Vader
Ocean Runner
20
Years of Service
User Offline
Joined: 18th May 2003
Location: United States
Posted: 16th Aug 2003 03:07
rnd(12) for 2 dice will not give you an acurrate representation of 2 dice rolling. Example: You are much more likely to roll a 7(6&1,5&2,4&3) then you are a 12(6&6).

"Computers in the future may weigh no more then
1.5 tons.
- Popular Mechanics, 1949
andrew11
21
Years of Service
User Offline
Joined: 23rd Feb 2003
Location: United States
Posted: 16th Aug 2003 06:51 Edited at: 16th Aug 2003 21:57
[edit]
RND(5) + RND(5) + 2 should do it

"All programmers are playwrites and all computers are lousy actors" -Anon
Steverino
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United States
Posted: 16th Aug 2003 18:11
I'd suggest
rnd(5) + rnd(5) + 2
since it's real hard to roll a 0 or a 1 with two dice.

____________________________________________
Surrealist writing toy -- http://www.iconpoet.com
andrew11
21
Years of Service
User Offline
Joined: 23rd Feb 2003
Location: United States
Posted: 16th Aug 2003 21:57
Oops. I forgot DB's random numbers start at 0.

"All programmers are playwrites and all computers are lousy actors" -Anon

Login to post a reply

Server time is: 2024-04-26 08:35:53
Your offset time is: 2024-04-26 08:35:53