- Space to enter/exit edit mode
- Alt gr to play pattern
- F01 - F1F Speed range (default F06) define ticks in one row
- F20 - FFF Tempo range (default F7D)
function inlist(list, item) | |
for i=1, #list do | |
if list[i].x == item.x and | |
list[i].y == item.y then | |
return true | |
end | |
end | |
return false | |
end |
function _init() | |
tile = 8 | |
gridlength = 8 | |
player = { | |
x = 8, | |
y = 8 | |
} | |
map = { |
-- 1. make zip and rename it to .love | |
-- 2. copy /b love.exe+mygame.love mygame.exe | |
-- or cmd /c copy /b love.exe+mygame.love mygame.exe | |
-- D:\repos\love-11.4-win64/lovec.exe . | |
function love.load() | |
TileSize = 32 | |
GridLength = 16 | |
Player = { |
RayCast = function(grid, cellX, cellY) | |
local points = {} | |
for angle = 0, 360, 1 do | |
local radius = TileSize | |
local targetX = cellX * TileSize | |
local targetY = cellY * TileSize | |
for i = 1, love.graphics.getWidth(), 1 do | |
if not PixelOutOfBounds(targetX, targetY) and | |
GetCellByPixelCoordinates(targetX, targetY, grid, TileSize) == 0 then |
-- Breadth first search. | |
function Bfs(startCell, targetCell) | |
local queue = {} | |
local path = {} | |
startCell.visited = true | |
table.insert(queue, startCell) | |
while #queue > 0 do | |
local currentCell = queue[1] |
import express from 'express'; | |
import jwt from 'jsonwebtoken'; | |
import bodyParser from 'body-parser'; | |
import bcrypt from 'bcrypt'; | |
import mongoose from 'mongoose'; | |
import 'dotenv/config'; // Import and configure dotenv. | |
import User from './user.js'; | |
const app = express(); | |
app.use(bodyParser.urlencoded({ extended: false })); // Parses urlencoded bodies. |
import { put, take, takeEvery, call, select } from "redux-saga/effects"; | |
import { eventChannel } from "redux-saga"; | |
import { io, Socket } from "socket.io-client"; | |
/* Event channel for converting incoming socket messages to saga events. */ | |
function createEventChannel(mySocket: Socket<any>) { | |
return eventChannel((emit) => { | |
mySocket.onAny((type: string, payload: any) => emit({ type, payload })); | |
return () => { | |
mySocket.close(); |
from pathlib import Path | |
import json | |
for path in Path('node_modules').rglob('package.json'): | |
with open(path) as jsonFile: | |
try: | |
jsonObject = json.load(jsonFile) | |
except: | |
print("ERROR: json load failed") | |
jsonFile.close() |
from importlib.metadata import metadata | |
print(metadata("flask-cors")["License"]) |