aboutsummaryrefslogtreecommitdiff
path: root/taipan.c
diff options
context:
space:
mode:
authorB. Watson <yalhcru@gmail.com>2016-01-30 05:56:28 -0500
committerB. Watson <yalhcru@gmail.com>2016-01-30 05:56:28 -0500
commitfee72cdb3651d2e5bfd5fe525c6498dc01fbbe01 (patch)
treee1b63c375d38f1db6a8a0db95bfbfe8780ee73da /taipan.c
parenta8f3491099463de93f15b710e98671037fcde072 (diff)
downloadtaipan-fee72cdb3651d2e5bfd5fe525c6498dc01fbbe01.tar.gz
use loop in set_prices(), save 142 bytes
Diffstat (limited to 'taipan.c')
-rw-r--r--taipan.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/taipan.c b/taipan.c
index 440b1cd..d734362 100644
--- a/taipan.c
+++ b/taipan.c
@@ -1290,7 +1290,6 @@ void cash_or_guns(void)
// cash = 3500000L;
#ifdef BIGNUM
big_copy(bank, big1M);
- // memcpy(bank, big1M, 6);
big_mul(bank, bank, big1M);
#else
bank = 1000000000L;
@@ -1319,13 +1318,18 @@ void cash_or_guns(void)
return;
}
-void set_prices(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];
+
+ /*
+ // using above for loop instead of the below, saves 142 bytes!
price[0] = base_price[0][port] / 2 * (randi()%3 + 1) * base_price[0][0];
price[1] = base_price[1][port] / 2 * (randi()%3 + 1) * base_price[1][0];
price[2] = base_price[2][port] / 2 * (randi()%3 + 1) * base_price[2][0];
price[3] = base_price[3][port] / 2 * (randi()%3 + 1) * base_price[3][0];
- return;
+ */
}