Esempio n. 1
0
def move():
    data = bottle.request.json
    # TODO: Do things with data
    direction = snake.doAction(data)

    print "Moving %s" % direction
    return MoveResponse(direction)
def test10(snake):
    return snake.doAction(test_data.data_dead_end_with_tail)
def test9(snake):
    return snake.doAction(test_data.data9)
def test8(snake):
    return snake.doAction(test_data.data8)
def test7(snake):
    return snake.doAction(test_data.data7)
def test6(snake):
    return snake.doAction(test_data.data6)
def test54(snake):
    return snake.doAction(test_data.data54)
def test3(snake):
    return snake.doAction(test_data.data3)
def test2(snake):
    return snake.doAction(test_data.data2)
Esempio n. 10
0
        }, {
            'x': 7,
            'y': 6
        }],
        'health':
        100,
        'id':
        'testsnake',
        'length':
        10,
        'name':
        'testsnake',
        'object':
        'snake'
    }
}

#interface World {
#  object: 'world';
#  id: number;
#  you: Snake;
#  snakes: List<Snake>;
#  height: number;
#  width: number;
#  turn: number;
#  food: List<Point>;
#}
snake = snake.snake()

print snake.doAction(data)