This is a SCRIPT-8 cassette.
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 G = love.graphics | |
function splitPoly(poly, mx, my, dx, dy) | |
local poly_a = {} | |
local poly_b = {} | |
local ax = poly[#poly-1] | |
local ay = poly[#poly ] | |
for i = 1, #poly, 2 do | |
local bx = poly[i ] |
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 G = love.graphics | |
math.randomseed(os.time()) | |
parts = {} | |
function find_partner(p) | |
while true do | |
local q = parts[math.random(#parts)] | |
if q ~= p and q ~= p.friend and q ~= p.enemy then |
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
#include <SDL/SDL.h> | |
#include <stdio.h> | |
#include <time.h> | |
enum { | |
CELL_SIZE = 20, | |
GRID_WIDTH = 10, | |
GRID_HEIGHT = 20, | |
}; |
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 sys, time, math, random | |
def get_foo(x, y): | |
d = 0 | |
for a, b, c in points: | |
d += c / (1 + (x - a)**2 + (y - b)**2) | |
return d | |
def march(a, b, c, d): |
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 isDown = love.keyboard.isDown | |
local bool = { [true] = 1, [false] = 0 } | |
local speed = 3 | |
local ball = { x = 0, y = 0, vx = -speed, vy = speed } | |
local pad1_y = 0 | |
local pad2_y = 0 | |
local score1 = 0 | |
local score2 = 0 | |
function love.update() | |
pad1_y = pad1_y + (bool[isDown"a"] - bool[isDown"q"]) * 7 |
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 graphics = love.graphics | |
function love.load() | |
local program = ([[ | |
const float kernel[5] = float[](0.2270270270, 0.1945945946, 0.1216216216, 0.0540540541, 0.0162162162); | |
vec4 effect(vec4 color, sampler2D tex, vec2 tex_coords, vec2 pos) { | |
color = texture2D(tex, tex_coords) * kernel[0]; | |
for(int i = 1; i < 5; i++) { | |
color += texture2D(tex, vec2(tex_coords.x + i * %f, tex_coords.y)) * kernel[i]; |