Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

GUESS THAT LANGUAGE

Name: Anonymous 2009-09-04 6:37


class Hello {
    string mesg;
    new() { mesg = "Hello World!\n"; }
    static void main() {
        print(mesg);
    }
}

Name: Not OP 2009-09-04 15:55

Round 2

#pragma indent
using System

def capitalize = str => Char.ToUpper(str[0]).ToString() + str.Substring(1);

def beers(n)
  | 0 => "no more bottles of beer"
  | 1 => "1 more bottle of beer"
  | _ => $"$n bottles of beer"

def onTheWall = n => $"$(beers(n)) on the wall, $(beers(n)).\n"

def passAround(n)
  | 0 => $"Go to the store and buy some more, $(beers(99)) on the wall.\n"
  | _ => $"Take one down and pass it around, $(beers(n-1)) on the wall.\n"

$[99, 98 .. 0].Iter(n => Console.WriteLine(capitalize(onTheWall(n)) + passAround(n)))

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List