Skip to content

Instantly share code, notes, and snippets.

@yutopp
Last active January 1, 2016 08:39
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yutopp/8119577 to your computer and use it in GitHub Desktop.
Save yutopp/8119577 to your computer and use it in GitHub Desktop.
ア…ア…
// 2013/12/25
def main(): void
{
val i = 0: int mutable;
while( i < 10 ) {
pl( i );
i = i + 1;
}
print( " #rill || #xmas\n" );
}
def pl( val i: int ): void
{
pw( i );
print("/");
val j = 0: int mutable;
while( j < i*2 ) {
pr( ( i / 2 + j ) % 4 );
j = j + 1;
}
print("\");
pw( i );
print( "\n" );
}
def pw( val b: int ): void
{
val max = 10: int;
val i = 0: int mutable;
while( i < max - b ) {
print( " " );
i = i + 1;
}
}
def pr( val b: int ): void
{
if ( b == 0 )
print( "-" );
else if ( b == 1 )
print( "*" );
else if ( b == 2 )
print( "-" );
else if ( b == 3 )
print( "o" );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment