summaryrefslogtreecommitdiff
path: root/src/z-rand.h
diff options
context:
space:
mode:
authorBardur Arantsson <bardur@scientician.net>2015-12-11 08:09:30 +0100
committerBardur Arantsson <bardur@scientician.net>2015-12-11 08:09:30 +0100
commit97bcf1bc612d9920390c885b8dcea0b0cda6f246 (patch)
treef9890fb08cc717fbc8837b58945f32dd64929b45 /src/z-rand.h
parente4b4f4730a2fb39da766892adbf3419bf5e7f48f (diff)
Migrate z-rand.c to C++
- Include explicitly instead of via angband.h - Change to regular functions instead of macros.
Diffstat (limited to 'src/z-rand.h')
-rw-r--r--src/z-rand.h90
1 files changed, 0 insertions, 90 deletions
diff --git a/src/z-rand.h b/src/z-rand.h
deleted file mode 100644
index ba17dabe..00000000
--- a/src/z-rand.h
+++ /dev/null
@@ -1,90 +0,0 @@
-#pragma once
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include "h-basic.h"
-
-
-
-/**** Available constants ****/
-
-
-/*
- * Random Number Generator -- Degree of "complex" RNG -- see "misc.c"
- * This value is hard-coded at 63 for a wide variety of reasons.
- */
-#define RAND_DEG 63
-
-
-
-
-/**** Available macros ****/
-
-
-/*
- * Generates a random long integer X where O<=X<M.
- * The integer X falls along a uniform distribution.
- * For example, if M is 100, you get "percentile dice"
- */
-#define rand_int(M) \
- (Rand_div(M))
-
-/*
- * Generates a random long integer X where A<=X<=B
- * The integer X falls along a uniform distribution.
- * Note: rand_range(0,N-1) == rand_int(N)
- */
-#define rand_range(A,B) \
- ((A) + (rand_int(1+(B)-(A))))
-
-/*
- * Generate a random long integer X where A-D<=X<=A+D
- * The integer X falls along a uniform distribution.
- * Note: rand_spread(A,D) == rand_range(A-D,A+D)
- */
-#define rand_spread(A,D) \
- ((A) + (rand_int(1+(D)+(D))) - (D))
-
-
-/*
- * Generate a random long integer X where 1<=X<=M
- * Also, "correctly" handle the case of M<=1
- */
-#define randint(M) \
- (rand_int(M) + 1)
-
-
-/*
- * Evaluate to TRUE "P" percent of the time
- */
-#define magik(P) \
- (rand_int(100) < (P))
-
-
-
-
-/**** Available Variables ****/
-
-
-extern bool_ Rand_quick;
-extern u32b Rand_value;
-extern u16b Rand_place;
-extern u32b Rand_state[RAND_DEG];
-
-
-/**** Available Functions ****/
-
-
-extern void Rand_state_init(u32b seed);
-extern s32b Rand_mod(s32b m);
-extern s32b Rand_div(s32b m);
-extern s16b randnor(int mean, int stand);
-extern s32b damroll(s16b num, s16b sides);
-extern s32b maxroll(s16b num, s16b sides);
-
-
-#ifdef __cplusplus
-} /* extern "C" */
-#endif