This file contains hidden or 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 pygame | |
import random | |
def get_moves(player, opponent, speed): | |
if speed == 0: # No move that can be made will have any effect, so why allow any? | |
return [] | |
valids = [] | |
# Get a piece. |
This file contains hidden or 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
love.graphics.setDefaultFilter("nearest", "nearest", 0) | |
love.graphics.setLineStyle("rough") | |
math = require("lib.mathsies") -- my maths lib | |
local assets = require("assets") --[=[ | |
-- it's a table of tables, an example being: | |
shaders = { | |
depth = {load = function(self) self.value = love.graphics.newShader("assets/shaders/depth.glsl") end} | |
} | |
]=] | |
local constants = require("constants") -- a table of categories, containing values |
This file contains hidden or 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 ffi = require("ffi") | |
ffi.cdef("double nextafter(double from, double to);") | |
local small = ffi.C.nextafter(0, 1) | |
local modes = { | |
nearest_toEven = {2, 2, -2, -2}, | |
nearest_truncate = {2, 3, -2, -3}, | |
truncate = {1, 2, -1, -2}, | |
ceiling = {2, 3, -1, -2}, |
This file contains hidden or 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
# PyUr — copyleft 2017 — is by | |
# Henry "wolfboyft" Fleminger Thomson, and | |
# licensed under the GNU GPL 3. | |
# Tested with Python 3.5 | |
from random import randint | |
import curses | |
white = "White" # Constant | |
black = "Black" # Constant |