Skip to content

Commit

Permalink
pseudo-random: tiny cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
lukstafi committed Mar 20, 2024
1 parent c5102c3 commit d513862
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions minidebug_runtime.ml
Original file line number Diff line number Diff line change
Expand Up @@ -717,11 +717,11 @@ module PrintBox (Log_to : Shared_config) = struct
fun () ->
let ( + ) = Int32.add in
let ( mod ) = Int32.rem in
(rand := Int32.(logxor !rand (shift_left !rand 13)));
rand := logxor !rand (shift_left !rand 13);
let r = to_int (128l + 64l + (!rand mod 50l)) in
(rand := Int32.(logxor !rand (shift_right_logical !rand 17)));
rand := logxor !rand (shift_right_logical !rand 17);
let g = to_int (128l + 64l + (!rand mod 50l)) in
(rand := Int32.(logxor !rand (shift_left !rand 5)));
rand := logxor !rand (shift_left !rand 5);
let b = to_int (128l + 64l + (!rand mod 50l)) in
Printf.sprintf "%x%x%x" r g b

Expand Down

0 comments on commit d513862

Please sign in to comment.