diff options
author | B. Watson <yalhcru@gmail.com> | 2021-03-25 03:52:27 -0400 |
---|---|---|
committer | B. Watson <yalhcru@gmail.com> | 2021-03-25 03:52:27 -0400 |
commit | ea2d5014ade974ca99678d3aac36ebd4c8e4d8c6 (patch) | |
tree | e02923fba1a64c3c7dfa4ff24d69ad09f9c1eef0 /taipan.c | |
parent | 9535946177debc5295ff47a9a09143d2c2de8c96 (diff) | |
download | taipan-ea2d5014ade974ca99678d3aac36ebd4c8e4d8c6.tar.gz |
Save 11 bytes
Diffstat (limited to 'taipan.c')
-rw-r--r-- | taipan.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -97,6 +97,8 @@ extern unsigned int __fastcall__ randi(void); #define randi() ((unsigned int)rand()) #endif +extern unsigned char rand1to3(void); + /* random long, 0 to 2**32-1 */ extern unsigned long __fastcall__ randl(void); @@ -1626,7 +1628,7 @@ void cash_or_guns(void) { void set_prices(void) { char i; for(i = 0; i < 4; ++i) - price[i] = base_price[i][port] / 2 * (randi()%3 + 1) * base_price[i][0]; + price[i] = base_price[i][port] / 2 * rand1to3() * base_price[i][0]; } unsigned int warehouse_in_use() { @@ -2825,7 +2827,7 @@ void elder_brother_wu(void) { } if((debt > 20000) && (cash > 0) && (one_chance_in(5))) { - unsigned char num = randi()%3 + 1; + unsigned char num = rand1to3(); cash = 0; port_stats(); |