Mercurial > hg > early-roguelike
annotate urogue/random.c @ 264:778938a5c21d
UltraRogue: add location for character files.
When using the -n option, UltraRogue will look for character files in a
single location, similar to save files.
The location is chosen by defining CHRDIR in getplay.c, at least until
UltraRogue gets integrated with the build systems.
| author | John "Elwin" Edwards | 
|---|---|
| date | Sun, 19 Feb 2017 19:47:09 -0500 | 
| parents | c495a4f288c6 | 
| children | 
| rev | line source | 
|---|---|
| 
256
 
c495a4f288c6
Import UltraRogue from the Roguelike Restoration Project (r1490)
 
John "Elwin" Edwards 
parents:  
diff
changeset
 | 
1 /* | 
| 
 
c495a4f288c6
Import UltraRogue from the Roguelike Restoration Project (r1490)
 
John "Elwin" Edwards 
parents:  
diff
changeset
 | 
2 random.c - random and associated routines | 
| 
 
c495a4f288c6
Import UltraRogue from the Roguelike Restoration Project (r1490)
 
John "Elwin" Edwards 
parents:  
diff
changeset
 | 
3 | 
| 
 
c495a4f288c6
Import UltraRogue from the Roguelike Restoration Project (r1490)
 
John "Elwin" Edwards 
parents:  
diff
changeset
 | 
4 UltraRogue: The Ultimate Adventure in the Dungeons of Doom | 
| 
 
c495a4f288c6
Import UltraRogue from the Roguelike Restoration Project (r1490)
 
John "Elwin" Edwards 
parents:  
diff
changeset
 | 
5 Copyright (C) 1992, 1993, 1995 Herb Chong | 
| 
 
c495a4f288c6
Import UltraRogue from the Roguelike Restoration Project (r1490)
 
John "Elwin" Edwards 
parents:  
diff
changeset
 | 
6 All rights reserved. | 
| 
 
c495a4f288c6
Import UltraRogue from the Roguelike Restoration Project (r1490)
 
John "Elwin" Edwards 
parents:  
diff
changeset
 | 
7 | 
| 
 
c495a4f288c6
Import UltraRogue from the Roguelike Restoration Project (r1490)
 
John "Elwin" Edwards 
parents:  
diff
changeset
 | 
8 See the file LICENSE.TXT for full copyright and licensing information. | 
| 
 
c495a4f288c6
Import UltraRogue from the Roguelike Restoration Project (r1490)
 
John "Elwin" Edwards 
parents:  
diff
changeset
 | 
9 */ | 
| 
 
c495a4f288c6
Import UltraRogue from the Roguelike Restoration Project (r1490)
 
John "Elwin" Edwards 
parents:  
diff
changeset
 | 
10 | 
| 
 
c495a4f288c6
Import UltraRogue from the Roguelike Restoration Project (r1490)
 
John "Elwin" Edwards 
parents:  
diff
changeset
 | 
11 #include "rogue.h" | 
| 
 
c495a4f288c6
Import UltraRogue from the Roguelike Restoration Project (r1490)
 
John "Elwin" Edwards 
parents:  
diff
changeset
 | 
12 | 
| 
 
c495a4f288c6
Import UltraRogue from the Roguelike Restoration Project (r1490)
 
John "Elwin" Edwards 
parents:  
diff
changeset
 | 
13 void | 
| 
 
c495a4f288c6
Import UltraRogue from the Roguelike Restoration Project (r1490)
 
John "Elwin" Edwards 
parents:  
diff
changeset
 | 
14 ur_srandom(unsigned x) | 
| 
 
c495a4f288c6
Import UltraRogue from the Roguelike Restoration Project (r1490)
 
John "Elwin" Edwards 
parents:  
diff
changeset
 | 
15 { | 
| 
 
c495a4f288c6
Import UltraRogue from the Roguelike Restoration Project (r1490)
 
John "Elwin" Edwards 
parents:  
diff
changeset
 | 
16 md_srandom(x); | 
| 
 
c495a4f288c6
Import UltraRogue from the Roguelike Restoration Project (r1490)
 
John "Elwin" Edwards 
parents:  
diff
changeset
 | 
17 } | 
| 
 
c495a4f288c6
Import UltraRogue from the Roguelike Restoration Project (r1490)
 
John "Elwin" Edwards 
parents:  
diff
changeset
 | 
18 | 
| 
 
c495a4f288c6
Import UltraRogue from the Roguelike Restoration Project (r1490)
 
John "Elwin" Edwards 
parents:  
diff
changeset
 | 
19 long | 
| 
 
c495a4f288c6
Import UltraRogue from the Roguelike Restoration Project (r1490)
 
John "Elwin" Edwards 
parents:  
diff
changeset
 | 
20 ur_random(void) | 
| 
 
c495a4f288c6
Import UltraRogue from the Roguelike Restoration Project (r1490)
 
John "Elwin" Edwards 
parents:  
diff
changeset
 | 
21 { | 
| 
 
c495a4f288c6
Import UltraRogue from the Roguelike Restoration Project (r1490)
 
John "Elwin" Edwards 
parents:  
diff
changeset
 | 
22 return( md_random() ); | 
| 
 
c495a4f288c6
Import UltraRogue from the Roguelike Restoration Project (r1490)
 
John "Elwin" Edwards 
parents:  
diff
changeset
 | 
23 } | 
