So while tofro's answer should work, one way or the other INKEY$ is not working properly on my current setup.
I have found a solution which several people have hinted at, which is to find some kind of counter in memory which can be read to give something like a random seed.
I found the exact solution here, but I have simplified things as I am not using an emulator, and I don't need all the PRINTed commentary. Basically the routine takes the value of register r which is counting CPU cycles from 0 to 127, not using bit 8. It uses the ROM ABPASS routine, which passes the contents of AB back to the USR call.
The simplified assembly language goes like this:
ABPASS = 0x117D .org 0xF800 usr: ld a, r ld b, a xor a ; clear a as you only want a one byte number jp ABPASS
And this can be executed in BASIC like this, with the seed used to then "roll a d6".
20 REM == poke at 0xF800 == 30 let mb=&HF800 100 REM == Poking in the 'random' seed program == 110 read op 120 if op = 999 then goto 200 130 poke mb, op 140 let mb = mb + 1 150 goto 110 200 REM == JP start address (c3 00 f8) jp f800 == 210 mb = &H8048 220 poke mb, &HC3 230 poke mb+1, &H00 240 poke mb+2, &HF8 260 seed = usr(0) 270 x = rnd(-seed) 280 print int(rnd(1)*6)+1 290 end 9000 REM == program == 9001 DATA 237, 95, 71, 175, 195, 125, 17 9003 DATA 999
This produces different results after a hard reset, and is adequately random for my purposes.
Having corrected some syntax errors from here I have also made a simpler routine using BASIC only which generates a random seed as INKEY$ would be able to if it were implemented:
10 OUT 128,22 20 PRINT "Roll a d6! (Hit any key)" 30 COUNT = -1 40 IF (INP(128) AND 1) = 0 THEN 100 50 I = INP(129) 60 OUT 128,150 70 S = RND (COUNT) 80 PRINT INT(RND (1)*6)+1 90 END 100 COUNT = COUNT - 1 110 GOTO 40
I is the ASCII value of the key(s) pressed, so that is a pretty direct way of doing INKEY$ in Nascom BASIC.