Random; Remainder; Rerandom - AMSTRAD cpc 6128 User Instruction

Integrated computer/disc system
Hide thumbs Also See for cpc 6128:
Table of Contents

Advertisement

random
Outputs a random non-negative integer less than the input number.
*
?random 20
7
remainder
Outputs the integer remainder obtained when the first input number is divided by
the second.
*
?remainder 7 3
1
?remainder 8 4
o
rerandom
Makes a subsequent random expression reproduce the same random sequence.
?repeat 10 [(type random 10 char 9)J
1
3
7
5
3
2
0
4
2
6
?repeat 10 [(type random 10 char 9)J
4
9
9
1
0
6
1
3
5
1
?rerandom
?repeat 10 [(type random 10 char 9)J
5
2
9
0
3
1
6
2
3
7
?rerandom
?repeat 10 [(type random 10 char 9)J
5
2
9
0
3
1
6
2
3
7
*
round
Outputs the input number rounded off to the nearest integer.
?round
3.333333
3
?round
3.5
4
Chapter 6 Page 14
Introduction to Logo

Advertisement

Table of Contents
loading

Table of Contents