TI-BASIC (TI-84+/SE), 36 bytes
There is no input, as the challenge specifies.
I survived! if successful, a
DIVIDE BY 0 error otherwise.
DIVIDE BY 0 error screen looks like the following:
ERR:DIVIDE BY 0
Selecting either option (and returning to home screen if
2 is selected) shows
Error after the program call.
startTmr→rand:1/(1<randInt(1,6:"I survived! ;full program
startTmr→rand ;store the current time into "rand"
; this is necessary because "rand" is 0 after
; factory reset, the default state for TI-BASIC
randInt(1,6 ;get a random integer in [1,6]
1< ;is greater than 1? 1 if true, 0 if false
1/( ;divide 1 by the result
; throws "DIVIDE BY 0" error if result was
"I survived! ;leave this string in "Ans"
;implicitly print "Ans"
TI-BASIC is a tokenized language. Byte count does not equal character count.
Lowercase letters are two bytes each.
- Lowercase letters can be enabled using this assembly program.
startTmr is a command only on the TI-84+ and TI-84+ SE calculators. Said calculators have different operating systems.