What programming language is this?
- by Richard M.
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
}