Changes

Jump to: navigation, search

Locomotive BASIC

312 bytes added, 21:50, 12 September 2012
/* RND [(n)] */
==== <code>RND [(n)]</code> ====
: Generates the next random number in the current squence if n is positive or omitted. If n = 0, the random number generated will be the same as the last random number generated.
 
: Exampel for generating an integer random number between 1 and 1000
<pre>
10 A=INT((RND(1)*1000)+1)
20 PRINT A
30 GOTO 10
</pre>
 
: Exampel for generating a random number between a lower and higher border
<pre>
10 INPUT "Low border",low
20 INPUT "High border",high
30 A=RND(1)*(high-low)+low
40 PRINT A
</pre>
==== <code>ROUND (n[,i1])</code> ====
205
edits