This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Game: | |
def __init__(self, data, player_id): | |
self.player_id = player_id | |
self.update(data) | |
def update(self, data): | |
self.turn = data['turn'] | |
self.robots = data['robots'] | |
self.onNewTurn() | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import copy | |
import imp | |
import random | |
import sys | |
import traceback | |
from collections import defaultdict | |
from rgkit import rg | |
from rgkit.settings import settings, AttrDict |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local serpent = require "serpent" | |
local function random_var(is_key, deep) | |
local key = math.random(1000) | |
if key <= 100 then | |
if is_key then | |
return 0 | |
else | |
return nil |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--*-lua-*-- | |
package = "metalua-parser" | |
version = "0.7.3-3" | |
source = { | |
url = "http://git.eclipse.org/c/koneki/org.eclipse.koneki.metalua.git/snapshot/org.eclipse.koneki.metalua-v0.7.3.tar.gz" | |
} | |
description = { | |
summary = "Metalua's parser: converting Lua source strings and files into AST", | |
detailed = [[ | |
This is a subset of the full Metalua compiler. It defines and generates an AST |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Checking main.lua Failure | |
main.lua:54:10: variable env was previously defined as an argument in the same scope | |
main.lua:111:10: variable args was previously defined as an argument in the same scope | |
Checking shnc.lua OK | |
Checking core/init.lua Failure | |
core/init.lua:23:7: unused variable xpcall | |
core/init.lua:51:4: setting non-standard global variable copy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--[[ | |
Argument type checking API. | |
This library declares a `checks()` function and a `checkers` table, which | |
allow to check the parameters passed to a Lua function in a fast and | |
unobtrusive way. | |
`checks (type_1, ..., type_n)`, when called directly inside function | |
`f`, checks that `f`'s 1st argument conforms to `type_1`, that its 2nd | |
argument conforms to `type_2`, etc. until `type_n`. Type specifiers |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Requires luacheck scm-6 | |
-- Reads a Lua program from stdin, prints program flow graph for top level closure. | |
-- Format: node id: (ids of previous nodes) -> ast node tag:line:column -> (ids of next nodes) | |
-- Crashes on `break` or `goto` or labels. | |
local flow = require "luacheck.flow" | |
local parser = require "metalua.compiler".new() | |
local src = assert(io.stdin:read("*a")) | |
local ast = assert(parser:src_to_ast(src)) | |
local intel = {closures = {{stmts = ast}}, gotos = {}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Requires luacheck scm-6 | |
-- Reads a Lua program from stdin, prints warnings for unreachable code in top level closure. | |
-- Crashes on `break` or `goto` or labels. | |
local flow = require "luacheck.flow" | |
local parser = require "metalua.compiler".new() | |
local src = assert(io.stdin:read("*a")) | |
local ast = assert(parser:src_to_ast(src)) | |
local intel = {closures = {{stmts = ast}}, gotos = {}} | |
flow(intel) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env luajit | |
local optimize = require "pf.optimize".optimize | |
local pp = require "pf.utils".pp | |
local expanded_src = [[ | |
{ "if", | |
{ "true" }, | |
{ "if", | |
{ "!=", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- luacheck configuration file for snabbswitch, requires luacheck 0.7.0. | |
-- Run luacheck as `luacheck -q src` from the snabbswitch root folder. | |
-- Ignore local variables defined twice in the same scope. | |
redefined = false | |
-- Ignore unused arguments and loop variables. | |
unused_args = false | |
-- Ignore unused values coming from a call of a multi-value function together with used ones. |
OlderNewer