- abricotine
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
| function love.conf(t) | |
| t.window.width = 1024 | |
| t.window.height = 1000 | |
| end |
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
| -- GistID: 3f8a0d2a40325dc358cccab2aa124984 | |
| local Vector = require('./vector') | |
| local Mover = {} | |
| Mover.__index = Mover | |
| function Mover.new(location, mass) | |
| local t = {} | |
| setmetatable(t, Mover) |
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 Ball = require('./ball') | |
| local Vector = require('./vector') | |
| local Water = require('./water') | |
| local balls | |
| local water | |
| function love.load() | |
| width = love.graphics.getWidth() | |
| height = love.graphics.getHeight() |
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
| Dark / Light | |
| Infinite runner where you are racing against a wall of light that is following you at increasing speed. There are obstacles and gaps that you have to jump over. | |
| You control the game, not the player | |
| Infinite runner where jumping actually drops the game level down. The farther you go the more points you get, you can use these points to unlock game changes like gravity settings, wind settings, and speed. | |
| Parallel Dimensions |
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 Class = {} | |
| Class.__index = Class | |
| function Class.new() | |
| local t = {} | |
| setmetatable(t, Class) | |
| return t | |
| end |
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
| // Note that this required lodash to work. | |
| function bogoSort(arr) { | |
| while(!sorted(arr)) { | |
| arr = _.shuffle(arr); | |
| } | |
| return arr; | |
| } |
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
| function bubbleSort(arr) { | |
| let temp; | |
| while(true) { | |
| let swaps = 0; | |
| for(let i = 0; i < arr.length -1; i++) { | |
| if(arr[i + 1] < arr[i]) { | |
| temp = arr[i]; | |
| arr[i] = arr[i + 1]; | |
| arr[i + 1] = temp; |
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
| function insertionSort(arr) { | |
| let temp; | |
| let i; | |
| for(let current = 0; current < arr.length; current++) { | |
| temp = arr[current]; | |
| for(i = current - 1; i >= 0 && arr[i] > temp; i--) { | |
| arr[i + 1] = arr[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
| function selectSort(arr) { | |
| let smallestIndex; | |
| let temp; | |
| for(let i = 0; i < arr.length - 1; i++) { | |
| smallestIndex = i; | |
| for(let j = i + 1; j < arr.length; j++) { | |
| if(arr[j] < arr[smallestIndex]) { | |
| smallestIndex = j; |