shithub: orca

Download patch

ref: e817cf5d5e6993d4b46539518bd4ec930698e45f
parent: 1a65a4931e18af58b517a263621220654689e6f5
author: Nicola Pisanti <nicola@npisanti.com>
date: Tue May 21 05:01:23 EDT 2019

random max now defaults to 36

--- a/sim.c
+++ b/sim.c
@@ -648,11 +648,13 @@
 
 BEGIN_OPERATOR(random)
   LOWERCASE_REQUIRES_BANG;
+  PORT(0, -1, IN);
   PORT(0, 1, IN);
-  PORT(0, 2, IN);
   PORT(1, 0, OUT);
-  Usz a = index_of(PEEK(0, 1));
-  Usz b = index_of(PEEK(0, 2));
+  Usz a = index_of(PEEK(0, -1));
+  Usz b = index_of(PEEK(0, 1));
+  if (b == 0)
+    b = 36;
   Usz min, max;
   if (a == b) {
     POKE(1, 0, glyph_of(a));