about summary refs log tree commit diff stats
path: root/archive/2.transect/factorial.k2
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2020-01-21 00:58:34 -0800
committerKartik Agaram <vc@akkartik.com>2020-01-21 00:58:34 -0800
commite2d73d037c6aa100c9d04d5c201ca2c9e74c63c0 (patch)
tree00576b34662fb1b4a09cae6bfb3df44ca1ef4793 /archive/2.transect/factorial.k2
parent6c8642f647331ddab90d716497fa48a0154aba51 (diff)
downloadmu-e2d73d037c6aa100c9d04d5c201ca2c9e74c63c0.tar.gz
5915
Diffstat (limited to 'archive/2.transect/factorial.k2')
0 files changed, 0 insertions, 0 deletions
3fc6bad4c5164e87'>8cb4e365 ^
0c44f591 ^
ca1afb29 ^
8b9f1750 ^
8cb4e365 ^
8cb4e365 ^






795f5244 ^
166e3c0d ^



8cb4e365 ^




1c57bab6 ^

ec99eb7a ^
1c57bab6 ^
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
                                             
            
                                        
                                                
                                       
                   

        
                                                
                   
                                                                
                                                         
                     






                                             
                                                                                  



                                       




                                                

                                      
                     
         
:(before "End Primitive Recipe Declarations")
REAL_RANDOM,
:(before "End Primitive Recipe Numbers")
put(Recipe_ordinal, "real-random", REAL_RANDOM);
:(before "End Primitive Recipe Checks")
case REAL_RANDOM: {
  break;
}
:(before "End Primitive Recipe Implementations")
case REAL_RANDOM: {
  // todo: limited range of numbers, might be imperfectly random
  // todo: thread state in extra ingredients and products
  products.resize(1);
  products.at(0).push_back(rand());
  break;
}

:(before "End Primitive Recipe Declarations")
MAKE_RANDOM_NONDETERMINISTIC,
:(before "End Primitive Recipe Numbers")
put(Recipe_ordinal, "make-random-nondeterministic", MAKE_RANDOM_NONDETERMINISTIC);
:(before "End Primitive Recipe Checks")
case MAKE_RANDOM_NONDETERMINISTIC: {
  break;
}
:(before "End Primitive Recipe Implementations")
case MAKE_RANDOM_NONDETERMINISTIC: {
  srand(time(NULL));
  break;
}

// undo non-determinism in later tests
:(before "End Reset")
srand(0);