Skip to content

Instantly share code, notes, and snippets.

View Capital-EX's full-sized avatar
🦖
Too busy stack shuffling

Capital-EX

🦖
Too busy stack shuffling
View GitHub Profile
@Capital-EX
Capital-EX / unlamdba_like_fib.lua
Last active December 8, 2017 20:28
Program written in Lua made to emulate Unlamdba's S K I operators.
s =
(function(x)
return function(y)
return function(z)
return x(z)(y(z))
end
end
end)
k =
@Capital-EX
Capital-EX / animate.shd
Last active February 1, 2019 08:16
Simple little shader to animate tiles in Godot
// Sprite sheet
uniform texture sprites;
// Distance to travel for next sprite
uniform vec2 offset_xy;
// Size of sprite sheet
uniform vec2 texture_wh;
// Number of frames
@Capital-EX
Capital-EX / load-png.hs
Created December 6, 2017 22:23
Functions to conver a DynamicImage (JuicyPixel) to a BMP (bmp) to us in Gloss
import qualified Data.ByteString.Lazy as BLazy
import Data.Bifunctor
import Graphics.Gloss
import Graphics.Gloss.Data.Picture
import Codec.Picture
import Codec.BMP
parseBMP :: BLazy.ByteString -> Either String BMP
parseBMP b = first show (parseBMP b)
Influenza A
# BITSY VERSION 4.5
! ROOM_FORMAT 1
PAL 0
NAME Home
18,38,55
237,187,240
Mi4wMDQ0fHwxNTE5MzUzNTIyMDE0OzE1MTkzNTM1MjIwMTQ7MTUxOTQ0NzA4NDc4NjsgREFOSyBNRU1FO2V5ZWRmfMOnwr3CpAx8NDE5Mjg5ODQwOS4wMjU3Njc7NTEwOTQ5NTYwNjMuNzk0MTg7NTMwOzU7MTcwNDc1NzUuMzQ0NjY3MDQ7MTAwOzA7MDswOzA7MDswOzA7MDswOzU7MDswOzA7MDswOzA7OzA7MDswOzA7MDswOzA7LTE7LTE7LTE7LTE7LTE7MDswOzA7MDs1MDswOzA7MDswOzE1MTkzNTM1MjIwMTE7fDExNiwxMTYsNzAyMjQwOTkzMSwwOzEwMiwxMDIsMTc3OTIwMTcyNywwOzg5LDg5LDc4NzkwMTY2MiwwOzczLDczLDI1NTU1MTk4ODcsMDs1Myw1Myw1MzcxMDcyMjgzLDA7NDEsNDEsMTI0OTE1MzcwNjIsMDsyMywyMywxMzc4MzQxNjIzNSwwOzYsNiw3Mjg0OTc2NTMxLDA7MCwwLDAsMDswLDAsMCwwOzAsMCwwLDA7MCwwLDAsMDswLDAsMCwwOzAsMCwwLDA7MCwwLDAsMDt8w6fCv8K8w6fCv8K/w6fCv8Kww6TCgMKAw6TCg8K/w6fCv8K+w6bCj8K8w6TCgMKCw6bCv8KAw6TCgMKAw6TCgMKPw6fCgsKgw6TCgMKAw6TCgMKAw6TCgMKAw6TCgMKMw6TCgMKAw6TCgMKAw6TCgMKAw6TCgMKAw6TCgMKAw6TCgMKAw6TCgMKAw6TCgMKAw6TCgMKAw6TCgMKAw6TCgMKAw6TCgMKAw6TCgMKAw6TCgMKAw6TCgMKAw6TCgMKAw6TCgMKAw6TCv8KAw6fCsMKDw6bCgMKPw6TCgMKAw6TCgMKAw6TCgMKAw6TCgMKAw6TCgMKAw6TCgMKAw6TCgMKAw6TCgMKAw6TCgMKAw6TCgMKAw6TCgMKAw6TCgMKAw6TCgMKAw6TCgMKAw6TCgMKAw6TCgMKAw6TCgMKAw6TC
extends Reference
var digits = IntArray()
var negative = false
const scale = 1000
const base = 1000
func _init(size = 0):
while digits.size() < size: digits.append(0)

The Void

Let's start from an empty project.

Unity Editor with the default scene

Now, Let's add an object to animate. Something simple, like a cube.

Unity Editor with a scene containing a cube

https://github.com/watson-developer-cloud/unity-sdk/issues/566
name: palindrome
source code: |
# Accepts palindromes made of the symbols 'a' and 'b'
input: 'abcdefghijklmnopqrstuvwxyzzyxwvutsrqponmlkjihgfedcba' # try a, ab, bb, babab
blank: ' '
start state: start
synonyms:
accept: {R: accept}
reject: {R: reject}
# A palindrome is either the empty string, a single symbol,
{
(set: $grid to
(a: (a: 0, 0, 0, 1, 0),
(a: 0, 1, 0, 1, 0),
(a: 0, 0, 1, 1, 0),
(a: 0, 0, 0, 0, 0),
(a: 0, 0, 0, 0, 0)))
(set: $len to $grid's length)
(for: each _row, ...$grid)[
(for: each _col, ..._row)[{