67

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 goodness for native Unicode support): with open(__file__, encoding="utf-8") as f: code = f.read() replacements = [ ("print", "γραψάτω"), ("input", ...


66

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, which can be replaced with an empty line. I'm using this interpreter, which prints an extra newline and cannot be suppressed. So the output have one more line than the original, and that can ...


45

Mathematica, 9 bytes Pluralize Yes, there is a built-in for this! Sample output Pluralize["car"] cars Pluralize /@ {"bus", "potato", "knife", "penny", "exception", "wolf", "eye"} {"buses", "potatoes", "knives", "pennies", "exceptions", "wolves", "eyes"}


36

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. #include <iostream> #include <fstream> using namespace std; static const char *reposita[][2] = { // Miscellanea {"iostream", "flumineie"}, // flumine inducto/educto {"ofstream", ...


32

Perl 6, 119 113 bytes {my \n=<① ⑳ ㉑ ㉟ ㊱ ㊿>.map:{|map *.uniname.words[2..*].join,$^a..$^b} /\d/??n[^$_]!!1..1+first $_,n,:k} Unicode database FTW! Uses upper-case written-out numbers without hypen, e.g. TWENTYTWO. Returns a list of strings, or a range of numbers. (Both use space as separator when printed with put.)


31

9 10 12 13 16 18 21 23 languages, 1000 bytes Bash (prints "duizend", Dutch) Zsh (prints "een Dausend", Luxembourgish) Dash (and other true POSIX shells) (prints "nje mije", Albanian) C (prints "et tusind", Danish) C++ (prints "ib txhiab", Hmong) brainfuck (prints "mille", Italian) boolfuck (prints "afe", Samoan) Brainlove (prints "mil", Spanish) 2DFuck (...


27

Python 2, 145 bytes print'i am now tiny @ @s##s#ed#act#acts#@#@s#@ed#@ing#arguments#accusation#accusations#advertisings'.replace('#',' counter').replace('@','check') Try it online! Prints these words, separated by spaces: i am now tiny check checks counter counters countered counteract counteracts countercheck counterchecks counterchecked counterchecking ...


26

V, 13 bytes cEHi<esc>A, <C-r>" V! Try it online! Inspired by tsh's answer This takes advantage of the fact that I'm is yanked from the start of the string when deleting the text from the start, and pastes it to the end with <C-r>" while in insert mode.


25

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. var file_system = require('fs'); file_system.readFile(__filename, function(error,code){ if (error) {throw error;} code = code.toString(); var words = { 'var': 'מש׳', ...


23

CJam, 0 incorrect, 32 29 bytes This code uses a few odd characters (some of them unprintable), but they are all well within extended ASCII range. So again, I'm counting each character as a single byte. "un"'el2b"zPB: ":i+:%2/* Due to the unprintable characters, I'm sure Stack Exchange swallows some, so you might want to copy the code from the character ...


22

Ruby, 0 incorrect, 63 56 53 52 51 50 bytes All characters are in extended ASCII, specifically ISO 8859-1, so I'm counting each character as a single byte. f=->s{s[/la|tt|i.e|[égdzœu]..$|^b|^f|so|^ta/]?'une':'un'} It looks like your test set was a bit too short. I've generated the regex with Peter Norvig's meta regex golfer. You can call the above ...


22

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. Since the poetry is included after the END line it doesn't actually get executed. The actual algorithm is pretty straight forward: Split input into tokens on ...


22

C, 160 bytes g(char*s){char i=1,r=0,*p="k^[#>Pcx.yI<7CZpVgmH:o]sYK$2";for(;*s^'-'&&*s;r+=*s++|9);r=r%45+77;for(;*p!=r;p++,i++);return((*s^'-')?0:g(s+1))+(i<21?i:10*(i-18));} Test it int main () { char* w[] = {"", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "ten", "eleven", "twelve", "thirteen", "fourteen", "...


19

Jelly,  49 35 31  30 bytes ṫ3,⁸Ṗ,$€ẎK “¤ƈȮⱮ⁴⁷ọḤƁŒ|⁾Ė»ḲÇ€K A niladic link returning a list of characters, or a full program printing that list as a string (the words delimited by spaces). Try it online! How? ṫ3,⁸Ṗ,$€ẎK - Helper link: list of characters, word e.g. "abreacts" ṫ3 - tail word from index 3 "reacts"...


18

C (gcc), 59 42 33 bytes -17 bytes thanks to @Conor O'Brien noticing that the import wasn't necessary -9 bytes thanks to @tsh pointing out a shorter, UB way of writing the function a(x){printf("Hi%s, I'm C!",x+3);} Try it online! Chops off the first 3 characters of the input (removes I'm) and surrounds it with the desired text.


17

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. Imports System.Collections.Generic Module Translator Sub Main() Dim translation As New Dictionary(Of String, String) With translation .Add("imports", "وارد‌کردن") ...


17

Retina, 162 137 145 134 131 129 Multiple punctuation is now handled correctly. Test case: You will not win this challenge...! -> Not win this challenge..., you will. Try it Online! [.!]$ T`A-Z`a-z`^\w\w G`^(I|we|you|s?he|it|they) \S+ \S (\S+ \S+) (.*) $2, $1. T`a-z`A-Z`^. ^$ Too difficult, this sentence is. Description: If there is punctuation in ...


17

Retina, 57 53 56 55 58 57 bytes Thanks to MartinEnder for some golfing suggestions Thanks to BusinessCat for golfing 1 byte ([^aeiou]o|sh?|ch|z|x)$ $1e fe?$ ve ([^aeiou])y$ $1ie $ s Try it online! Explanation (outdated) ([^aeiou])y$ $1ie Changes {consonant}y to {consonant}ie ([^aeiou]o|[fxzs]|[sc]h)$ $&e Appends an e to when the word ends with ...


16

Retina, 54 53 bytes T`au`ie`y. wa we T`\oeuia`ao T`ko`stn\hmyr\w`.a ^a ka Try it online. Explanation Wooo, showing off even more features from today's 0.7.2 release. :) (The release predates this challenge by about 7 hours.) T`au`ie`y. This is a transliteration which replaces a with i and u with e, but only in matches of y.. The purpose of that is to ...


16

Retina, 23 bytes i`[cprt]h|dd|ff|ng|ll|. Try it online! Even moar regex.


16

PowerShell, 166 163 bytes 'a an and' '','s','le','ler','lers'|%{"hand$_"} ($a="character") ($x=-split"s ed ful ized istic istics ization izations istically ologically"|%{"$a$_"}) "un"+$x[8] Try it online! Hand-optimized, no algorithms. The two loops |%{ } tack on the appropriate ending to the appropriate beginning. I'm searching for a way to get them down ...


16

V, 13 bytes cEHi<Esc>A, <C-O>p V! Try it online! New to V. Just knew it about 30 minutes ago. Anyway, this language is chosen just because its name only cost 1 byte. I'm not sure how to send <End> key in V. Most vim environment would accept <End> as a replacement of <Esc>A in this example. But, you know, V is 2 ...


15

GolfScript, 19 characters n%{'aeiouy'&,6=},n* Usage: golfscript vowels.gs < wordlist.txt Output: abstemiously authoritatively behaviourally [...] uninformatively unintentionally unquestionably unrecognisably If you also want to output the count at the end you can use n%{'aeiouy'&,6=},.n*n@, which is four characters longer.


15

CJam, 61 58 51 48 46 43 41 38 bytes leuS-',/{':/W>:~_2*2<~z),>1f&\,5--~}%, Verify the test cases in the CJam interpreter. How it works leuS- e# Read a line from STDIN, convert to uppercase and remove spaces. ',/ e# Split at commas. { e# For each chunk: ':/W> e# Split at colons and only keep the last chunk. :~ ...


15

Python 2 I know that @atlasologist already posted a solution in Python 2, but the way my works is a bit different. This works by going through all holes, from top to bottom, left to right, looking 5 characters back and at the character above, and finding a character where these matches. If multiple characters are found, it picks the most common one. In case ...


15

Python 2, 36 bytes lambda n:'5521'[n%~9/-3>>n/10%~9/-9] Try it online! Same length arithmetically: lambda n:5/(n%~9/-3>>n/10%~9/-9or 1) Let's first look at simpler code that doesn't account for teens. lambda n:'5521'[n%~9/-3] Here, we want a mapping of the one's digit to an output that works like [5, 1, 2, 2, 2, 5, 5, 5, 5, 5][n%10] But, ...


14

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. I am using a regular expression with two groups (([^a-zA-Z\\d:])*) to match individual items prepended/followed by a non-alphanumeric character. This solved ...


14

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 Zamanälif the official alphabet for the Tatar language, criminalizing the official use of any alphabet other than Cyrillic. In the past century, there have ...


14

Jelly, 25 bytes ṣ⁶f€ØB;”-¤Œl©Qµ®ċЀĠṪịµẋE Try it online! or verify all test cases.


14

JavaScript (ES6), 347 336 326 325 308 bytes for(a=btoa`...`.split(i=0);i<101;i++)alert(i<13?a[i]:i<20?(a[i]||a[i-10])+"teen":i>99?"one hundred":(i%10?a[i%10]+" and ":"")+(i<30?"twenty":i<40?"thirty":i<50?"forty":(i%20>9?"half "+["third","forth","fifth"][i/20-2|0]:a[i/20|0])+" times twenty")) Before running, replace the ... with the ...


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