What programming language is this?
Posted
by Richard M.
on Stack Overflow
See other posts from Stack Overflow
or by Richard M.
Published on 2010-05-18T18:06:48Z
Indexed on
2010/05/18
18:10 UTC
Read the original article
Hit count: 281
language-agnostic
|General
I recently stumbled over a very odd source listing on a rather old programming-related site (lost it somewhere in my browser history as I didn't care about it at first).
I think that this is part of a simple (console-based?) snake game.
I searched and searched but didn't find a language that looked somwhat like this. This seems like a mix of Python, Ruby and C++. What the hell?
- What programming-language is the below source listing written in?
Maybe you can figure it out?
my Snake.hasProps
{
length
parts
xDir
yDir
} & hasMethods {
init: length = 0
parts[0].x,y = 5
move: parts[ 0 ].x,y.!add xDir | yDir # Move the head
map parts(i,v): parts[ i ] = parts[ i + 1 ]
checkBiteSelf
checkFeed
checkBiteSelf: part
}
my SnakePart.hasProps
{
x
y
}
fork SnakePart to !Feed
my Game.hasProps
{
frameTime = 30
} & hasMethods {
init: mainloop
mainloop: sys.util.sleep frameTime
Snake.move
Field.getInput -> Snake.xDir | Snake.yDir
Field.reDraw with Snake
& Feed
& Game # For FPS
}
main.isMethod
{
game.init
}
© Stack Overflow or respective owner