68 votes

Translate your English source code into a foreign language

Python, Koine Greek - Πύθων My favorite programming language, in my favorite foreign language--perfect! And it doesn't hurt that the name is already Greek. The translator program in Python 3 (thank ...
  • 34.4k
66 votes

Translate your English source code into a foreign language

Chicken, Chinese - 鸡 Chicken is much harder to use than I thought. There isn't a trailing newline. But the final chicken is just for marking the end of this program,...
  • 36.2k
39 votes

Count Like a Babylonian

JavaScript (ES6), 44 bytes Takes input as an array of ASCII characters. a=>a.map(c=>k+=c<1?k*59:c<'?'?10:c<{},k=0)|k Try it online! How? The ...
  • 171k
37 votes

Convert C header names to C++ header names

80386 machine code, 13 bytes Hexdump of the code: b0 63 86 01 41 3c 2e 75 f9 c6 01 00 c3 Source code (can be compiled by Visual Studio): ...
  • 12.3k
36 votes

Translate your English source code into a foreign language

C++, Latin - C Plus Plus Yes, that is an actual translation of the language name. They didn't have the plus sign, but they gave us the word plus. ...
  • 5,291
32 votes

Temperature Converter

Python 3, 118 116 bytes I=input() t=eval(I[:-1]) u=ord(I[-1])%7 exec("u=-~u%3;t=[t*1.8-459.67,(t-32)/1.8,t+273.15][u];print(t,'FCK'[u]);"*2) Performs the ...
  • 61.1k
29 votes

Sᴍᴀʟʟ Cᴀᴘꜱ Cᴏɴᴠᴇʀᴛᴇʀ

Retina, 73 bytes T`a-z`ᴀʙᴄᴅᴇꜰɢʜɪᴊᴋʟᴍɴᴏᴘǫʀꜱᴛᴜᴠᴡxʏᴢ This is exactly what Retina's transliterate mode was made for. It replaces all lowercase letters (...
25 votes

Translate your English source code into a foreign language

JavaScript (NodeJS) - Hebrew My method for encoding is pretty similar to DLosc's Python program: It reads the source code, has a list of tokens, and runs find-and-replace. ...
  • 2,935
25 votes

Sᴍᴀʟʟ Cᴀᴘꜱ Cᴏɴᴠᴇʀᴛᴇʀ

Pyth, 61 59 58 bytes LXbGsmC+*7389<dGCd"#ʙ'(*ꜰɢʜɪ-.ʟ0ɴ2;ǫʀꜱ>?CDxʏE This defines a named function y. Try it online in ...
  • 207k
24 votes

Convert a string of digits from words to an integer

PHP, 74 bytes foreach(explode(' ',$argn)as$w)$n.='793251_8640'[crc32($w)%20%11];echo+$n; Try it online! Tried to get a solution which doesn't copy existing ...
  • 5,877
23 votes

Bake me some moji

bash, 14 bytes iconv -fCP1252 Try it online!
  • 70.6k
22 votes

Convert English to a number without built-ins or libraries

C, 160 bytes ...
  • 987
20 votes

Translate your English source code into a foreign language

Perl, PigLatin - erlPay First, the actual program is very short, so to demonstrate how it behaves for longer sections of text I included some Perl Poetry as a further example of the input/output. ...
20 votes

Bake me some moji

Java 8, 72 66 36 25 bytes s->new String(s,"cp1252") Try it online. ...
19 votes

Goodness, it's covered in tabs!

K5, 53 45 bytes {{,/(b+a&~b:x*&\a:9=y){$[x;x#" ";y]}'y}[x]'y} In action: ...
  • 4,952
19 votes

Running length of the movie in a human readable format

Python 3, 50 67 119 116 112 111 104 94 bytes I'm not fond of going back to %-style string formatting, but it saves 6 bytes on ...
  • 12.1k
17 votes

Translate your English source code into a foreign language

Visual Basic .Net, Persian I chose a verbose language so it would be harder. Turns out, I didn't have to change the grammar. The Persian form of the code is just as verbose. ...
  • 389
17 votes
Accepted

Golf Text into DNA

Jelly, 15 13 bytes OVBs2UḄị“GCTA Try it online! or verify all test cases. How it works ...
  • 207k
17 votes

Neutralize data

JavaScript (ES6), 53 47 bytes f=o=>o.big?o.replace(/./g,' '):o.map?o.map(f):0 Test cases ...
  • 171k
17 votes

How much Mana do I need?

Python 2, 135 119 115 bytes b=[int('27169735 2 4567 435262'[int(x,36)%141%83%50%23])for x in input()] print b[0]+sum(a*-~b[0]/2for a in b[1:]) Try it online! ...
  • 55.2k
15 votes

Translate your English source code into a foreign language

Java, German - Java This program is really straight forward. It just reads the file given as the first argument and replaces all occurrences of an English word with the respective German translation. ...
  • 915
15 votes

Text animation format Code Golf

Python 3, 57 bytes lambda s:eval(s.upper().translate({70:'+[',87:']*'})[1:]) Turns a string like f1w0f2w10 into a expression ...
  • 139k
14 votes

String to Binary

Python 3, 41 bytes print(*[bin(ord(x))[2:]for x in input()]) Like KSFT's answer, but I thought I'd point out that, in addition to ...
  • 61.1k
14 votes

Convert C header names to C++ header names

Python: 19 characters lambda s:'c'+s[:-2]
  • 417
14 votes

Convert C header names to C++ header names

CJam, 6 bytes 'clW(< This is a full program which reads the string via STDIN Explanation: ...
  • 26.3k
14 votes

Brainf*** to tinyBF converter

Extended BrainFuck 276 bytes (not counting uneccesary linefeeds) ...
  • 3,828
14 votes

Translate your English source code into a foreign language

Julia, Tatar - Julia This uses the unofficial Latin-based Zamanälif alphabet for İdel-Ural Tatar, established in 2001. However, in 2002, the Russian Federation struck down Tatarstan's motion to make ...
  • 24.2k
14 votes

Convert an Excel date code to a "date"

Excel, 3(+7?) =A1 with format yyy/m/d Pure port
14 votes

Convert superscript numbers to normal numbers

JavaScript, 20 bytes s=>s.normalize`NFKD` Try it online!
  • 35.9k
13 votes
Accepted

String to Binary

CJam, 8 bytes l:i2fbS* Easy-peasy: ...
  • 26.3k

Only top scored, non community-wiki answers of a minimum length are eligible