Difference between revisions of "RandomBetween Command"

From GeoGebra Manual
Jump to: navigation, search
m (removed extra CAS syntax)
m (Text replace - ";(.*)\[(.*)\]" to ";$1($2)")
Line 1: Line 1:
 
<noinclude>{{Manual Page|version=5.0}}</noinclude>{{command|cas=true|probability}}
 
<noinclude>{{Manual Page|version=5.0}}</noinclude>{{command|cas=true|probability}}
; RandomBetween[ <Minimum Integer> , <Maximum Integer> ]: Generates a random integer between ''minimum'' and ''maximum'' (inclusive).
+
; RandomBetween( <Minimum Integer> , <Maximum Integer> ): Generates a random integer between ''minimum'' and ''maximum'' (inclusive).
 
:{{example| 1=<div><code><nowiki>RandomBetween[0, 10]</nowiki></code> yields a number between ''0'' and ''10'' (inclusive)</div>}}
 
:{{example| 1=<div><code><nowiki>RandomBetween[0, 10]</nowiki></code> yields a number between ''0'' and ''10'' (inclusive)</div>}}
;RandomBetween[ <Minimum Integer> , <Maximum Integer> , <Boolean Fixed> ]
+
;RandomBetween( <Minimum Integer> , <Maximum Integer> , <Boolean Fixed> )
 
: If ''Boolean Fixed'' = "true", it generates a random integer between ''minimum'' and ''maximum'' (inclusive), which is updated just once (when file is loaded and also on undo/redo).
 
: If ''Boolean Fixed'' = "true", it generates a random integer between ''minimum'' and ''maximum'' (inclusive), which is updated just once (when file is loaded and also on undo/redo).
 
:{{example| 1=<div><code><nowiki>RandomBetween[0, 10, true]</nowiki></code> yields a number between ''0'' and ''10'' (inclusive)</div>}}
 
:{{example| 1=<div><code><nowiki>RandomBetween[0, 10, true]</nowiki></code> yields a number between ''0'' and ''10'' (inclusive)</div>}}

Revision as of 17:17, 7 October 2017


RandomBetween( <Minimum Integer> , <Maximum Integer> )
Generates a random integer between minimum and maximum (inclusive).
Example:
RandomBetween[0, 10] yields a number between 0 and 10 (inclusive)
RandomBetween( <Minimum Integer> , <Maximum Integer> , <Boolean Fixed> )
If Boolean Fixed = "true", it generates a random integer between minimum and maximum (inclusive), which is updated just once (when file is loaded and also on undo/redo).
Example:
RandomBetween[0, 10, true] yields a number between 0 and 10 (inclusive)
Note: Press F9 to see the difference between those two syntaxes.
© 2024 International GeoGebra Institute