source:
data/trunk/scripts/secondprisoner.lua
@
3991
Last change on this file since 3991 was 3991, checked in by bensch, 18 years ago | |
---|---|
File size: 343 bytes |
Rev | Line | |
---|---|---|
[3946] | 1 | |
2 | -- Initialises the random number generator | |
3 | randinit = false | |
4 | function randInit() | |
5 | ||
6 | if not randinit then | |
7 | math.randomseed(os.clock()) | |
8 | randinit = true | |
9 | end | |
10 | ||
11 | end | |
12 | ||
13 | ||
14 | function scream() | |
15 | ||
16 | end | |
17 | ||
18 | function tick(timestep) | |
19 | ||
20 | --io.write("Secondprisoner called \n") | |
21 | randInit() | |
22 | randNumber = 10 * math.random() | |
23 | ||
24 | if randNumber > 8 then | |
25 | scream() | |
26 | end | |
27 | ||
28 | return false | |
29 | end |
Note: See TracBrowser
for help on using the repository browser.