Jump to content

- - - - -

(newbie) Creating A Dice Roller Program For Fx-9860g

  • Please log in to reply
3 replies to this topic

#1 SCasio



  • Members
  • Pip
  • 1 posts

  • Calculators:
    Casio fx-115 ES natural display
    Casio fx-9860G Slim

Posted 05 February 2011 - 07:22 AM

I want to create a dice rolling program suitable for most RPGs. At a minimum, I'd like to be able to give roll results for a variable number of all standard gaming dice (e.g. d2, d3, d4, d6, d8, d10, d12, d20, and d%). I assumed when I started looking that something like this would be easy to find, but so far nothing's turned up and I figure creating a program like this would be as good an introduction into programming as any. Thanks for your help.
This is what I've been able to do so far. It's really crude and pretty ugly.[codebox]1->D
Lbl 1
Locate 11,3, Int (Ran# *4)+1
Locate 11,4, Int (Ran# *6)+1
Locate 11,5, Int (Ran# *8)+1
Locate 11,6, Int (Ran# *10)+1
D=1=>Goto 1[/codebox]

Edited by SCasio, 05 February 2011 - 07:35 AM.

#2 E_net4


    Casio Freak

  • Members
  • PipPipPipPip
  • 189 posts
  • Gender:Male
  • Location:Output("Error: Coord type not specified");
  • Interests:Programming 'n' stuff...

  • Calculators:
    CASIO fx 9860G SD

Posted 08 February 2011 - 11:58 PM

Hello and welcome to UCF.

There doesn't seem to be anything wrong with that code, concerning number generating. Ran# returns a number between 0 and 1. Int(6 * Ran#)+1 will truly return an integer between 1 and 6 inclusive. It's nothing that special.

In addition, if you update your calculator's OS at edu.casio.com, the 2.00 version includes other random number generating functions, such as RanInt#(x, y), which returns an int between x and y inclusive.

Edited by E_net4, 08 February 2011 - 11:59 PM.

#3 somebody1234


    Casio Addict

  • Members
  • PipPipPip
  • 51 posts

  • Calculators:
    Casio fxcg10
    Casio fx-9860GII
    Casio Classpad 400

Posted 08 February 2014 - 02:41 AM

There is a Dice Rolling Add-in at the Casio website.

#4 flyingfisch


    Casio Maniac

  • Deputy
  • PipPipPipPipPipPipPipPip
  • 1891 posts
  • Gender:Male
  • Location:OH,USA
  • Interests:Aviation, Skiing, Programming, Mountain Biking.

  • Calculators:
    fx-CG10 PRIZM

Posted 09 February 2014 - 03:40 AM

Just to clarify, it is called ProbSim. You will have to select it on the download site. ;)

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users