This file contains 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
/// @ignore | |
function __pool() { | |
static pool = []; | |
return pool; | |
} | |
function pool_get(container) { | |
var pool = __pool(); | |
var poolMax = array_length(pool) - 1; |
This file contains 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
#![feature(generic_const_exprs)] | |
#![allow(incomplete_features)] | |
trait Factorialable<const N : usize> { | |
fn value() -> usize; | |
} | |
impl Factorialable<0> for () { | |
fn value() -> usize { 1 } | |
} |
This file contains 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 manager = script.Parent | |
-- helper function for colliding with humanoids | |
local function TouchedHumanoid(f) | |
return function(collider) | |
local parent = collider.Parent | |
if parent:FindFirstChildWhichIsA("Humanoid") then | |
f(parent) | |
end | |
end |
This file contains 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
fst((A, _), A). | |
snd((_, B), B). | |
name("katsaii"). | |
?- | |
name(Name), | |
findall((Prefix, Suffix), string_concat(Prefix, Suffix, Name), Pairs), | |
maplist(fst, Pairs, Prefixes), | |
maplist(snd, Pairs, Suffixes), |
This file contains 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
distance(A, B, Dist) :- | |
A = (X1, Y1), | |
B = (X2, Y2), | |
Dx is X2 - X1, | |
Dy is Y2 - Y1, | |
Dist is sqrt(Dx * Dx + Dy * Dy). | |
closest([X | Xs], Target, Min) :- | |
distance(X, Target, Dist), | |
closest_ext(Xs, Target, (X, Dist), Min). |
This file contains 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
/* Deferred Exeuction of Code | |
* -------------------------- | |
* Kat @Katsaii | |
*/ | |
#macro DEFER for (;; { | |
#macro UNTIL ; break; }) |
This file contains 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
/* Singleton object utilities | |
* -------------------------- | |
* Kat @Katsaii | |
*/ | |
#macro __instance_create_layer_internal instance_create_layer | |
#macro __instance_create_depth_internal instance_create_depth | |
#macro instance_create_layer instance_create_checked_layer | |
#macro instance_create_depth instance_create_checked_depth | |
#macro PREFIX_SINGLETON "the" |
This file contains 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
/// @desc Draws a bezier curve with 3 control points. | |
/// @param x1 {Real} The X coordinate of the first control point. | |
/// @param y1 {Real} The Y coordinate of the first control point. | |
/// @param x2 {Real} The X coordinate of the second control point. | |
/// @param y2 {Real} The Y coordinate of the second control point. | |
/// @param x3 {Real} The X coordinate of the third control point. | |
/// @param y3 {Real} The Y coordinate of the third control point. | |
/// @author Kat @katsaii | |
var x1 = argument0; | |
var y1 = argument1; |
This file contains 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
/// @desc Tokenises a string into a list of values. | |
/// @param str {String} The string to tokenise. | |
/// @author Kat @katsaii | |
var str = argument0; | |
var tokens = []; | |
var len = string_length(str); | |
for (var i = 1; i <= len; i++) { | |
var prefix = string_char_at(str, i); | |
if (char_is_whitespace(prefix)) then continue; | |
var value = undefined; |
This file contains 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 <stdio.h> | |
#include <stdlib.h> | |
void swap(int* a, int i, int j) { | |
int temp = a[i]; | |
a[i] = a[j]; | |
a[j] = temp; | |
return; | |
} |
NewerOlder