28
\$\begingroup\$

Write a program which plays Russian Roulette!

If the program is started,

  • there should be a 5 in 6 chance of it ending normally after printing "I survived!"
  • there should be a 1 in 6 chance of the program crashing. (segmentation fault, etc.)

No input, and no other outputs are allowed.

The randomness must be fair: it must have a uniform probability distribution. This means an uninitialized variable (or a RNG without seed) MOD 6 will not be sufficient.

If the solution works with only one dedicated operating system / platform, you will receive a 6 byte penalty to the score.

Shortest code wins, not sooner than 10 days after first valid answer.

\$\endgroup\$
  • 1
    \$\begingroup\$ Can we rely on the underlying runtime to be fair, even if not explicitly guaranteed in documentation? E.g. Python's randrange(5) might be implemented as randrange(MAX_INT)%6. \$\endgroup\$ – ugoren Nov 26 '12 at 5:35
  • \$\begingroup\$ To inspire creativity, you might consider granting a bonus to those solutions which don't rely on division by zero. \$\endgroup\$ – primo Nov 27 '12 at 17:04
  • \$\begingroup\$ Perhaps said bonus should involve dividing the score by 2. \$\endgroup\$ – Joe Z. Feb 15 '13 at 15:46
  • 1
    \$\begingroup\$ @JoeZeng : that would have been too much. Usually you can make it a different error, like null pointer reference, etc. for the cost of just a few characters. \$\endgroup\$ – vsz Feb 15 '13 at 16:53
  • \$\begingroup\$ I see. I'm not too experienced in creating scoring conditions for code golf puzzles, so I'm still learning stuff like that. \$\endgroup\$ – Joe Z. Feb 15 '13 at 16:55

46 Answers 46

4
\$\begingroup\$

05AB1E, 13 12 bytes

6LΩiFë“IЖd!

-1 byte thanks to @Emigna.

05AB1E actually shouldn't be able to error at all, but since the new version of 05AB1E still has some issues compared to the legacy version, I can take that to my advantage to error out for this challenge.

Try it online.

Explanation:

6L          # Create the list [1,2,3,4,5,6]
  Ω         # Get a random choice from this list
   i        # If it is 1:
    F       #  Do a ranged loop, which currently results in a "(RuntimeError) Could not
            #  convert  to integer." error when no argument is given
   ë        # Else:
    “IЖd!  #  Push dictionary string "I survived!" (which is output implicitly as result)

See this 05AB1E tip of mine (section How to use the dictionary?) to understand why “IЖd! is "I survived!".

\$\endgroup\$
  • \$\begingroup\$ Seems like 5ÝΩz“IЖd! should work but apparently 1 / 0 = 0. \$\endgroup\$ – Magic Octopus Urn Apr 10 at 17:17
  • 1
    \$\begingroup\$ @MagicOctopusUrn Yeah, 05AB1E almost never errors.. Apart from the pretty old builtin .0 which used to throw a division by 0 error to STDERR in an old version of 05AB1E, I don't even know how to error in the legacy 05AB1E at all.. The new version still has quite a lot of errors however, which I took to my opportunity here. ;) \$\endgroup\$ – Kevin Cruijssen Apr 10 at 19:02
  • 1
    \$\begingroup\$ I miss the old .0, on more than one occasion it made someone go "Wat... Why is that a command?" \$\endgroup\$ – Magic Octopus Urn Apr 10 at 19:14
11
\$\begingroup\$

PHP 38 bytes

<?~$$s[rand(+$s=sssss,5)]?>I survived!

Placing a + before a non-numeric string will evaluate to 0. Should rand(0,5) return 5, $s[rand(0,5)] will be the empty string (since $s is only five characters long), and subsequently $$s[rand(0,5)] will be an uninitialized variable. Attempting to take the inversion will halt on Unsupported Operand Type. Any other value, 0-4 will return s, and because $s is defined, you will survive.

Note: as of php version 4.2.0, the random number generator is seeded automatically.

\$\endgroup\$
6
\$\begingroup\$

R 30

"I survived!"[6*runif(1)<5||Z]

One time out of six, it will throw an error: Error: object 'Z' not found

\$\endgroup\$
6
\$\begingroup\$

Ruby, 24-28

p rand(6)<5?"I survived!":1/0

Approx each 6 time, there is a ZeroDivisionError

There is even a shorter version with 24 characters (Thanks to ugoren and histocrat):

6/rand(6);p"I survived!"

If you don't accept the " in the output, then I need 3 more characters. The first option (puts) adds a newline, the second ($><<) makes no newline:

6/rand(6);puts"I survived!"
6/rand(6);$><<"I survived!"

There is a question about random number in ruby at SO. The seed with srand is automatically called with the seed being from the current time if it wasn't already called. (see Julians comment)


Primo had the idea for an extra bonus to those solutions which don't rely on division by zero.

My first solution can be shortened (28 characters) with a undefined local variable or method ``a' for main:Object (NameError)

p rand(6)<5?"I survived!":a
\$\endgroup\$
  • \$\begingroup\$ Can be even shorter with 6/rand(6). \$\endgroup\$ – ugoren Nov 26 '12 at 5:36
  • \$\begingroup\$ Does Ruby seed its RNG automatically? \$\endgroup\$ – vsz Nov 26 '12 at 7:08
  • \$\begingroup\$ You can trim another three characters by removing the control flow: 1/rand(6);p "I survived!" \$\endgroup\$ – histocrat Nov 26 '12 at 23:30
  • \$\begingroup\$ @ugoren / histocrat Thanks for your hints, I adapted my solution. \$\endgroup\$ – knut Nov 26 '12 at 23:36
  • \$\begingroup\$ Another byte for you: no white space is required between p and "I survived!". By my count, that's only 24 bytes. \$\endgroup\$ – primo Nov 27 '12 at 7:43
6
\$\begingroup\$

Dyalog APL - 25 22 21 20 Charachters

'I Survived!'⊣1÷6⊤?6

Prints DOMAIN ERROR as the error, due to division by zero.

Shortest non-division by zero solution I could come up with is 23 characters.

('I Survived!'1)[~6⍷?6]

It throws an INDEX ERROR

Try it here

APL Font here

\$\endgroup\$
  • \$\begingroup\$ I would like to accept it, but it does not seem to work. A few times it prints "I survived", but after printing DOMAIN ERROR once, it keeps printing only that. Even if I reload the site completely, it will never ever survive again. \$\endgroup\$ – vsz Jan 19 '13 at 11:45
  • \$\begingroup\$ @vsz How strange... It works in my Dyalog APL WS, and I remember testing it with TryAPL when I was done. It still works on my interpreter, but not on the website. If this helps: dl.dropbox.com/u/9086539/apl.png \$\endgroup\$ – MrZander Jan 21 '13 at 19:12
  • \$\begingroup\$ I tried it with other interpreters, like ngn.github.com/apl/web/index.html but it doesn't work. Please provide a link to an interpreter where it works, possibly with an explanation whether the RNG must be seeded or is seeded automatically. Otherwise I'll have to accept the golfscript solution. \$\endgroup\$ – vsz Feb 11 '13 at 16:29
  • 1
    \$\begingroup\$ 1÷0 is a DOMAIN ERROR in Dyalog but in ngn/apl it's . The result from ?6 is 1..6 when ⎕IO←1 (default in Dyalog) and 0..5 when ⎕IO←0 (only option in ngn/apl). In Dyalog, the PRNG can be seeded by setting ⎕RL. Initially it has some pre-determined default value. If you set ⎕RL←0, the PRNG is re-seeded fairly unpredictably by the OS. TryAPL is using Dyalog and does support the ? function. \$\endgroup\$ – ngn Dec 5 '14 at 23:43
  • 1
    \$\begingroup\$ By the way, here's an 18-character solution: 'I survived!'⊣÷⍟?6 \$\endgroup\$ – ngn Dec 12 '14 at 0:37
5
\$\begingroup\$

Python, 96

from ctypes import*
from random import*
randrange(5)or pointer(c_int())[9**9]
print'I survived!'

If randrange(5) returns 0, then python will crash due to a segmentation fault.

\$\endgroup\$
5
\$\begingroup\$

vba, 27

?1/int(6*rnd),"I Survived!"

used in immediate window.
On failure, an error window stating:
division by zero
appears

\$\endgroup\$
  • \$\begingroup\$ Missing the ! in the text. \$\endgroup\$ – steenslag Nov 26 '12 at 21:59
  • \$\begingroup\$ @steenslag , fixed \$\endgroup\$ – SeanC Nov 27 '12 at 3:22
  • \$\begingroup\$ @SeanCheshire I've offered an alternative to your answer. \$\endgroup\$ – Gaffi Feb 12 '13 at 12:21
5
\$\begingroup\$

Befunge - 48 chars

 v >91+"!devi"v
/?>?<v"I surv"<
 / / :
   :,_@#

Befunge's only randomness is the ? operator, which sends you heading in one of four posible directions (1/4 chance). By blocking one or two directions, you have 1/3 or 1/2 chance, and by combining these, you get 1/6 chance to get out of the program "alive".

The program crashes by doing a divive-by-zero. I guess it's implementation-specific what will happen (on Wikipedia it says the program should ask for the desired answer), but befungee.py sort of crashes, or exits angrily:

$ for i in {1..6} ; do ./befungee.py roulette.befunge ; done
Error (1,2): integer division or modulo by zero
Error (3,2): integer division or modulo by zero
Error (1,2): integer division or modulo by zero
I survived!
Error (0,1): integer division or modulo by zero
I survived!
\$\endgroup\$
5
\$\begingroup\$

J, 18

'I survived!'[q:?6

Failing with domain error when trying to factorise 0.

\$\endgroup\$
  • \$\begingroup\$ Does J seed its RNG automatically? \$\endgroup\$ – vsz Feb 15 '13 at 7:09
  • \$\begingroup\$ @vsz Yes, with ?. You can use ?. for fixed seed. \$\endgroup\$ – randomra Feb 15 '13 at 7:14
4
\$\begingroup\$

C, 67 65 62 chars

rand()%8 doesn't lose fairness. Division crashes for t=0, gives true for 1 and 2 (retry), gives false for 3..7 (survived).
EDIT: The previous version used a temporary variable, which ended up completely unneeded. 2/(rand()%8) implements both needed conditions.

main(){
        for(srand(time(0));2/(rand()%8););
        puts("I survived!");
}
\$\endgroup\$
  • \$\begingroup\$ It does. "no other outputs are allowed" \$\endgroup\$ – vsz Nov 25 '12 at 8:35
  • \$\begingroup\$ @vsz, somehow missed it. But anyway, with gcc/Linux it doesn't print anything. Also, strictly adhering to the standard, this requirement is impossible, because undefined behavior might print anything. \$\endgroup\$ – ugoren Nov 25 '12 at 8:51
  • \$\begingroup\$ @vsz, fixed now - no extra output in any case. Also works with optimization, and 2 characters shorter. \$\endgroup\$ – ugoren Nov 25 '12 at 8:59
4
\$\begingroup\$

T-SQL 56 44 40 + 6

 if 1/cast(ceiling(rand()*6)-1as int)<2print'I Survived!'

Credit Sean Cheshire for calling out cast as unnecessary

 if 1/ceiling(rand()*6-1)<2print'I Survived!'

Credit personal message from Sean Cheshire for suggestion to change ceiling to floor.

 if 1/floor(rand()*6)<1print'I Survived!'

Death Err Msg: Msg 8134, Level 16, State 1, Line 3 Divide by zero error encountered.

\$\endgroup\$
  • 1
    \$\begingroup\$ -1 and ceiling are not needed. cast will truncate \$\endgroup\$ – SeanC Nov 28 '12 at 16:13
  • \$\begingroup\$ I'm testing if ceiling can be removed without violating the requirement for uniform distribution, the docs say that rand() returns float values 0 through 1. \$\endgroup\$ – freewary Nov 28 '12 at 16:30
  • \$\begingroup\$ I wanted to know if ceiling could be removed from my first entry. I was unable to determine from T-SQL documentation if the rand() function would ever return a 1 or not. So I ran a loop about 50 million times testing the rand() function, never once did it return a 1. But, removing ceiling from my first entry would still be 47 bytes, so my second entry is still shorter. Keep ceiling and remove cast. \$\endgroup\$ – freewary Nov 30 '12 at 16:55
  • \$\begingroup\$ I doubt you have tested this script more than 20 times. This doesn't always return the expected result always. 1 in 6 this will fail and not return an output. This syntax will work: 0/floor(rand()*6)=0 \$\endgroup\$ – t-clausen.dk Apr 9 at 7:54
3
\$\begingroup\$

Javascript, 42

(Math.random()*6|0)?alert('i survived!'):b

The bitwise or floors the result of the multiplication thus a value between 0 and 5 results. 0 gets implictly casted to false, so in 5 of 6 cases the alert appears in the 6th case a certain b is referenced, crashing the process.

\$\endgroup\$
3
\$\begingroup\$

Using the usual divide by zero method:

Perl 5.8 Version

1/(int rand 6)&&print "I survived!"

Perl 5.10 Version

1/(int rand 6)&&say "I survived!"

On failure, these will display:

Illegal division by zero at -e line 1.

Using the bless function which is used for creating objects in perl.

Perl 5.8 Version

print (int rand 6?"I survived!":bless me);

Perl 5.10 Version

say (int rand 6?"I survived!":bless me);

On failure, these will display:

Can't bless non-reference value at -e line 1.
\$\endgroup\$
  • 3
    \$\begingroup\$ a few suggestions: get rid of parentheses, the logical &&, and the extra space. use ~~ instead of int to force integral values. the result is this: 1/~~rand 6;print"I survived!" \$\endgroup\$ – ardnew Nov 28 '12 at 17:46
3
\$\begingroup\$

GolfScript, 21 chars

,6rand/;'I survived!'

Like most of the answers, this one has a one in six chance of crashing with a ZeroDivisionError. The shortest solution I could manage without using division by zero is 23 chars:

5,6rand=+;'I survived!'

which has a 1/6 chance of crashing with undefined method `+' for nil:NilClass (NoMethodError).

(Ps. While developing this, I found what might be a bug in the GolfScript interpreter: code like 0,1> appears to leave a nil value on the stack, which will later crash the program if you try to do anything with that value except pop it off and throw it away with ;. Unfortunately, the fact that I do need to use the value somehow to trigger a crash means that even exploiting this bug didn't help me get below 23 chars.)

\$\endgroup\$
  • \$\begingroup\$ That definitely seems like a bug. 5,5> leaves [] on the stack, which is probably what it should do, but 4,5> leaves nil. If you don't remove it, the interpreter will actually crash while trying to output it. An interesting side-effect is that 4,6rand>+;'I survived!' becomes a valid solution. Someone should probably inform Flagitious. \$\endgroup\$ – primo Dec 5 '12 at 18:31
  • 1
    \$\begingroup\$ I reported this, and it has been fixed (along with another bug I stumbled across) in the latest version of the GolfScript interpreter. \$\endgroup\$ – Ilmari Karonen Dec 13 '12 at 20:47
3
\$\begingroup\$

Python, 70 characters

With inspiration from grc's answer.

from random import*
if randrange(5)<1:exec'()'*9**5
print'I survived!'

randrange(5) returns a value between 0 and 5.
If it returns a 0, Python crashes while attempting to exec(ute) a string of code that contains 9^5 sets of parentheses.

\$\endgroup\$
3
\$\begingroup\$

PHP - 30 bytes

<?rand(0,5)?:~[]?>I survived!

Requires PHP 5.4+ for the short array syntax, invalid operator idea shamelessly stolen from @primo.

As stated, rand() is automatically seeded on first use.

\$\endgroup\$
  • \$\begingroup\$ Division by zero does not halt, it only produces a warning, as well as the text 'I survived!'. Also, rand()%6 is not a uniform distribution, as 32768 = 2 (mod 6). However, rand(0,5)||~$a for 30 bytes is, and will additionally work with all PHP versions (the second expression in a ternary is only optional in 5.3.0+). \$\endgroup\$ – primo Dec 5 '12 at 10:24
  • \$\begingroup\$ @primo Guess I was only looking for the stack trace when I was checking the divide by zero one, didn't notice it still printed. I know the ternary shorthand is 5.3+, but I really have no interest in supporting long out of date versions :) \$\endgroup\$ – Leigh Dec 5 '12 at 12:03
  • \$\begingroup\$ That I agree with. There's no valid argument for continuing to use less than 5.3 at this point. 5.4, I'm still holding out for a double-digit revision number. \$\endgroup\$ – primo Dec 5 '12 at 14:01
  • 1
    \$\begingroup\$ I count 29 bytes. \$\endgroup\$ – Titus Nov 16 '17 at 23:39
3
\$\begingroup\$

Befunge, 38

v>25*"!devivrus I",,,,,,,,,,,@
?^
v
?^
<1

Pretty straight-forward. Crashing is done by pushing 1s onto the stack until it overflows. I made a few attempts at cutting out those 11 commas and replacing them with some more efficient loop to print everything, but couldn't get it under 11 characters.

Note that counting characters in Befunge is a little tricky... For instance there's only one character on the third line, but I'm counting an extra one there since execution could travel through that location.

\$\endgroup\$
  • \$\begingroup\$ I believe that's the record for the most consecutive commas I've ever seen in a program. \$\endgroup\$ – Joe Z. Feb 15 '13 at 15:47
  • \$\begingroup\$ And then I look up how Befunge actually works and palm my face. \$\endgroup\$ – Joe Z. Feb 15 '13 at 15:48
2
\$\begingroup\$

CMD Shell (Win XP or later), 40 +6

I'm only doing this one because DOS is not something that should even be thought of for code golf, and the whitespace is important

set/a1/(%RANDOM% %% 6)&&echo I Survived!

On failure, it will print

Divide by zero error.

\$\endgroup\$
2
\$\begingroup\$

R, 50 44 42 36

ifelse(!is.na(sample(c(NA,1:5),1)),'I Survived!',)

ifelse(floor(runif(1,0,5))>0,'I Survived!',)

ifelse(floor(runif(1,0,5)),'I Survived!',)

ifelse(sample(0:5,1),'I Survived!',)

Death Err Message:

Error in ifelse(!is.na(1/sample(c(NA, 1:5), 1)), "I Survived!", ) : argument "no" is missing, with no default

\$\endgroup\$
  • \$\begingroup\$ I tried R, and couldn't get it to fail - if(1/0)"I Survived!" still printed I Survived \$\endgroup\$ – SeanC Nov 27 '12 at 22:55
  • \$\begingroup\$ Unlike other languages, R doesn't consider 1/0 to be a math error and doesn't stop execution, it just returns inf for 1/0. I think @vsz wants a breaking error for this round. But supposing vsz counted NA as the death error, I could get my program down to 41 characters: ifelse(sample(c(NA,1:5),1),'I Survived',) \$\endgroup\$ – freewary Nov 27 '12 at 23:05
2
\$\begingroup\$

Emacs-Lisp, 42 characters

(if (= (random 6) 5) 
    z (message "I survived!")
    )
\$\endgroup\$
2
\$\begingroup\$

Javascript, 40 chars

In Javascript the divide-by-zero trick doesn't even work: it just returns Infinity. Therefore, referencing a non-existing variable:

alert(6*Math.random()|0?"I survived!":f)

Not so short, though fun :)

\$\endgroup\$
2
\$\begingroup\$

PowerShell, 40 Chars

IF(6/(Get-Random -Max 6)){'I Survived!'}

On Failure: "Attempted to divide by zero."

\$\endgroup\$
  • \$\begingroup\$ Welcome to PPCG! \$\endgroup\$ – Laikoni Apr 8 at 21:29
  • 1
    \$\begingroup\$ 32 bytes \$\endgroup\$ – mazzy Apr 9 at 6:24
  • \$\begingroup\$ 31 bytes \$\endgroup\$ – Veskah Jul 12 at 12:48
2
\$\begingroup\$

TI-BASIC (TI-84+/SE), 36 bytes

startTmr→rand:1/(1<randInt(1,6:"I survived!

There is no input, as the challenge specifies.
Output is I survived! if successful, a DIVIDE BY 0 error otherwise.

The DIVIDE BY 0 error screen looks like the following:

ERR:DIVIDE BY 0
1:Quit
2:Goto

Selecting either option (and returning to home screen if 2 is selected) shows Error after the program call.

Examples:

prgmCDGFE
           Error
prgmCDGFE
I survived!
prgmCDGFE
I survived!
prgmCDGFE
           Error

Explanation:

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
                                              ; submissions
                   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
                                              ; false
                               "I survived!   ;leave this string in "Ans"
                                              ;implicitly print "Ans"

Notes:

  • 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.

\$\endgroup\$
2
\$\begingroup\$

Python, 53 bytes

Here's a short 53 byte python index out of range program:

import time
[0][time.time()%6<1]
print("I survived!")
\$\endgroup\$
  • \$\begingroup\$ Hi and welcome. Please note that in the rules for this challenge, it states "MOD 6 will not be sufficient." Although I'm not familiar with Python, it looks to me like you are using Modulo here. \$\endgroup\$ – Shaun Bebbers May 10 at 11:56
  • 1
    \$\begingroup\$ @ShaunBebbers The quote is "This means an uninitialized variable (or a RNG without seed) MOD 6 will not be sufficient," but this meta post says that current time modulo is enough for a PRNG for code-golf \$\endgroup\$ – Stephen May 10 at 13:26
  • \$\begingroup\$ My misunderstanding then. \$\endgroup\$ – Shaun Bebbers May 10 at 13:51
1
\$\begingroup\$

Java, 149

public class R{public static void main(String[]s){int[]a={1,1,1,1,1};System.out.println(a[new java.util.Random().nextInt(7)]>0?"I survived!":"");}}

Fails with an "Array out of bounds" error. Managed to shave a few characters by using anonymous Random object (no imports).

\$\endgroup\$
1
\$\begingroup\$

Groovy, 39

1/new Random().next(6);print"I survived!"

Picks a random number between 0 and 5 inclusive. If 0, throws a divide by zero exception.

\$\endgroup\$
1
\$\begingroup\$

Python (56), Haskell (77)

This crashes with an IndexError when the generated number is 1:

from random import*
print['I survived!'][1/randint(1,7)]

The Haskell solution has the same idea:

import System.Random
main=putStrLn.(["I survived!"]!!).div 1=<<randomRIO(1,6)
\$\endgroup\$
1
\$\begingroup\$

Python, 59 55 53, 65 59 56

import os
1/(ord(os.urandom(1))%6)
print"I survived!"

ZeroDivisionError when ord(os.urandom(1))%6 evaluates to 0

import os
print(["I survived!"]*5)[ord(os.urandom(1))%6]

IndexError when ord(os.urandom(1))%6 evaluates to 5

\$\endgroup\$
  • \$\begingroup\$ Save 5 characters by changing the import: import random as r then use r.randint \$\endgroup\$ – Steven Rumbalski Feb 11 '13 at 20:50
  • 1
    \$\begingroup\$ Or save 8 characters by changing import to import os, then use ord(os.urandom(1))%6 as your random int. \$\endgroup\$ – Steven Rumbalski Feb 11 '13 at 20:59
  • \$\begingroup\$ Save 1 character by removing the space after print. \$\endgroup\$ – Steven Rumbalski Feb 11 '13 at 21:01
1
\$\begingroup\$

VBA - 39/46

I don't love Sean Cheshire's numeric output (though still a good answer, it technically fails the No input, and no other outputs are allowed. from the spec...), plus he uses /0, so here are my alternatives:

?Mid("I Survived!",IIf(Int(6*Rnd),1,0))

This resolves to a Run-time error '5': Invalid procedure when trying to reach character 0 (VBA is 1-based indexing).

n="I Survived!":If Int(6*Rnd) Then ?n Else ?-n

This resolves to a Run-time error '13': Type mismatch when applying a negative switch to a string.

\$\endgroup\$
1
\$\begingroup\$

Japt v1.4.5, 16 bytes

6ö
ªí
`I s¨viv!

Try it

-1 byte thanks to @Shaggy!

Throws TypeError: U.í is not a function when a random number in the range [0,6) is 0.

\$\endgroup\$
  • 1
    \$\begingroup\$ 17 bytes \$\endgroup\$ – Shaggy Apr 11 at 7:13
  • \$\begingroup\$ Actually, it might be an idea to use v1.4.5 for this, just in case ETH adds an N.í() method to v1.4.6. \$\endgroup\$ – Shaggy Apr 11 at 9:11
  • \$\begingroup\$ Updated - Japt tries hard not to crash on weird programs. I was trying to figure out how to reference a variable that didn't exist (A-Z is defined), but didn't consider calling a method that didn't exist. \$\endgroup\$ – dana Apr 11 at 9:22
  • \$\begingroup\$ Yeah, N.í() is my "go to" for throwing an error (it used to be N.y()). There are a few other ways of getting an error but they're rarely useful. \$\endgroup\$ – Shaggy Apr 11 at 9:49
  • \$\begingroup\$ Now, why didn't I think of using a 3rd line?! :\ \$\endgroup\$ – Shaggy Apr 11 at 20:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.