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
shader_type canvas_item; | |
const vec4 background = vec4(1., 1., 1., 0.); | |
uniform float pixel_scale: hint_range(0.0, 1.0) = 1.0; | |
float dist(vec4 c1, vec4 c2) { | |
return (c1 == c2) ? 0.0 : abs(c1.r - c2.r) + abs(c1.g - c2.g) + abs(c1.b - c2.b); | |
} |
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
shader_type canvas_item; | |
const vec4 background = vec4(1., 1., 1., 0.); | |
float dist(vec4 c1, vec4 c2) { | |
return (c1 == c2) ? 0.0 : abs(c1.r - c2.r) + abs(c1.g - c2.g) + abs(c1.b - c2.b); | |
} | |
bool similar(vec4 c1, vec4 c2, vec4 input) { | |
return (c1 == c2 || (dist(c1, c2) <= dist(input, c2) && dist(c1, c2) <= dist(input, c1))); |
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
// odin file extension used for syntax highlighting | |
do:gol { | |
// no strings yet so not printing anything yet | |
width := readint(); | |
height := readint(); | |
tile_count := width*height; | |
// exit immediately if board has no dimensions | |
if tile_count == 0 { |
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
#define INTRINSICS_IMPLEMENTATION | |
#include "intrinsics.h" | |
#include "core.h" | |
#include "core.c" | |
typedef void(*fn_void)(); | |
typedef void* p_void; | |
typedef p_void(*fn_size_t_p_void)(size_t); | |
typedef bool_(*fn_p_void_size_t_bool_)(p_void,size_t); | |
typedef size_t(*fn_size_t)(); | |
typedef u64(*fn_u64)(); |
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
do:gol { | |
width := readint(); | |
height := readint(); | |
tile_count := width*height; | |
if tile_count == 0 { | |
printint(0); | |
println(); | |
break:gol 1; |
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
array_t :: (!u: type) -> type { | |
return struct { | |
items: &u = .{}; | |
count := 0; | |
capacity := 0; | |
}; | |
}; | |
push :: (arr: &!u, val: !v) -> void { | |
new_capacity := arr.capacity; |