ref: c980c1442abcbfade0380f53337efe626d1379cd
parent: 1a65a4931e18af58b517a263621220654689e6f5
parent: e817cf5d5e6993d4b46539518bd4ec930698e45f
author: Nicola Pisanti <nicola@npisanti.com>
date: Tue May 21 05:02:36 EDT 2019
Merge pull request #35 from npisanti/master 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));