summaryrefslogtreecommitdiff
path: root/random.cpp
diff options
context:
space:
mode:
authorReimar <Reimar@Leike.name>2014-12-04 12:02:53 +0100
committerReimar <Reimar@Leike.name>2014-12-04 12:02:53 +0100
commitd7c0925b3d7ffb1a58402c05e664966e2f8a597f (patch)
tree62cef6cc5b74481799c10dab8a18e756b74ea7e9 /random.cpp
parent33e9f1db579685dd1ffab767ba7733a8e9503c78 (diff)
downloadSpaceCannon-d7c0925b3d7ffb1a58402c05e664966e2f8a597f.tar
SpaceCannon-d7c0925b3d7ffb1a58402c05e664966e2f8a597f.tar.gz
SpaceCannon-d7c0925b3d7ffb1a58402c05e664966e2f8a597f.tar.bz2
SpaceCannon-d7c0925b3d7ffb1a58402c05e664966e2f8a597f.tar.xz
SpaceCannon-d7c0925b3d7ffb1a58402c05e664966e2f8a597f.zip
added custom random generator, ball no has a roll animation, revisited difficulty impact
Diffstat (limited to 'random.cpp')
-rw-r--r--random.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/random.cpp b/random.cpp
new file mode 100644
index 0000000..92a3c4c
--- /dev/null
+++ b/random.cpp
@@ -0,0 +1,18 @@
1
2long long rand_state = 24;
3long long rand_para1 = 37;
4long long rand_para2 = 37;
5
6int randn()
7{
8 rand_state = (rand_state*rand_state + rand_state*rand_para1 +rand_para2)%15555557;
9 return rand_state;
10}
11
12//seed with number from 0 to 672
13void srandn(int seed)
14{
15 rand_state = seed + 2753;
16
17 randn();
18}