File tree 2 files changed +18
-1
lines changed
HeavyCore/Common/Utilities
Playgrounds/Core.playground/Pages/Random.xcplaygroundpage
2 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ public struct PRNG {
23
23
mutating func next( ) -> UInt {
24
24
let s0 : UInt = state [ 0 ]
25
25
var s1 = state [ 1 ]
26
- let result = s0 &* s1
26
+ let result = s0 &+ s1
27
27
28
28
s1 ^= s0
29
29
state [ 0 ] = rotateLeft ( s0, b: 55 ) ^ s1 ^ ( s1 << 14 )
Original file line number Diff line number Diff line change @@ -95,4 +95,21 @@ sameSeedCheck // Expected to be true
95
95
" ** EXPECT TO BE TRUE ** "
96
96
diffSeedCheck // Expected to be true
97
97
98
+
99
+ x. nextUInt ( 0 , max: 1 )
100
+ x. nextUInt ( 0 , max: 1 )
101
+ x. nextUInt ( 0 , max: 1 )
102
+ x. nextUInt ( 0 , max: 1 )
103
+ x. nextUInt ( 0 , max: 1 )
104
+ x. nextUInt ( 0 , max: 1 )
105
+ x. nextUInt ( 0 , max: 1 )
106
+ x. nextUInt ( 0 , max: 1 )
107
+ x. nextUInt ( 0 , max: 1 )
108
+ x. nextUInt ( 0 , max: 1 )
109
+ x. nextUInt ( 0 , max: 1 )
110
+ x. nextUInt ( 0 , max: 1 )
111
+ x. nextUInt ( 0 , max: 1 )
112
+ x. nextUInt ( 0 , max: 1 )
113
+ x. nextUInt ( 0 , max: 1 )
114
+ x. nextUInt ( 0 , max: 1 )
98
115
//: [Next](@next)
You can’t perform that action at this time.
0 commit comments