# Rosetta Stone Code Challenge

I presume you've all heard of the Rosetta Stone, an ancient stone found to have essentially the same passage written on it in three different scripts. This challenge is based upon that: you have to write three versions of the same program in different languages.

The three programs must output the first n iban numbers, n being a number input by the user. There are only 30,275 iban numbers, so if n is greater than 30275, the program should return an error.

The challenge of the Rosetta Stone was that the scripts didn't appear to be mutually intelligible–knowing one didn't automatically make the others understandable. Your three programs should similarly be mutually unintelligible. That is, you may not golf down a Python 2 program and then submit it (or a minor modification) as a Python 3 version too, nor a C program as C++, etc. To prevent this, the Levenshtein distance between any two versions should be at least 25% of the length of the shorter of the two versions being compared, and at least 16 as an absolute numerical value. You may check conformance using this online Levenshtein distance calculator.

The winner is the person with the shortest combination of programs.

• What should the output be if n > 30275? Aug 20, 2014 at 14:54
• The first time around, I read "iban number" as IBAN number, unfortunately. Aug 20, 2014 at 15:05
• I think you can save this problem by making the scoring strictly objective. The "popularity" scoring is usually a last resort for fun problems that are otherwise impossible to score. Aug 20, 2014 at 19:22
• @BetaDecay What about banning the versions of the same language, and supersets (e.g. C++ and C or Objective-C and C), and each program has to differ by at least 10 characters (excluding variable names)?
– Milo
Aug 20, 2014 at 21:39
• I've edited the question to provide a way of easily verifying conformance with the spirit of the question, but had to invent thresholds. I think they're reasonable but you may want to tweak them, @BetaDecay. Aug 22, 2014 at 10:02

import System.Environment
main=do i<-getArgs;putStr.show$[n|n<-[0..777777],all(notElem"5689").show$n,all(\d->ndivdmod100notElem13:[30..39])[1,1000]]!!(read.head$i)  ## Python 2, 156 import sys print[n for n in range(777778)if all([c not in"5689"for c in str(n)])and all([n/d%100not in[13]+range(30,40)for d in[1,1000]])][int(sys.argv[1])]  ## Perl, 97 98 $i=@ARGV[0];die if $i>30275;for(0..777777){push@n,$_ if!(/[5689]/ or/(13|3.)(|...)$/)}print@n[$i]