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
fn linear_lerp(a: f32, b: f32, x: f32) -> f32 { | |
a + (b - a) * x | |
} | |
fn cosine_lerp(a: f32, b: f32, x: f32) -> f32 { | |
let x = 0.5 - (x.fract() as f32 * f32::consts::PI).cos() * 0.5; | |
a + (b - a) * x | |
} | |
fn perlin_ext(pos: Vec3<f32>, seed: u32, lerp: fn(f32, f32, f32) -> f32, octaves: usize, freq_factor: f32, scale_factor: f32) -> f32 { |
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
use std::{ | |
sync::mpsc, | |
thread::{self, JoinHandle}, | |
collections::{HashMap, HashSet}, | |
}; | |
// Error | |
#[derive(Debug)] | |
pub enum Error { |
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
#!/usr/bin/env bash | |
set -e | |
cweb_version=0.6.24 | |
cweb=https://github.com/koute/cargo-web/releases/download/$cweb_version/cargo-web-x86_64-unknown-linux-gnu.gz | |
curl -Lo cargo-web.gz $cweb | |
gunzip cargo-web.gz | |
chmod u+x cargo-web |
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
#!/usr/bin/env bash | |
set -e | |
cweb_version=0.6.24 | |
cweb=https://github.com/koute/cargo-web/releases/download/$cweb_version/cargo-web-x86_64-unknown-linux-gnu.gz | |
curl -Lo cargo-web.gz $cweb | |
gunzip cargo-web.gz | |
chmod u+x cargo-web |
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
#!/usr/bin/env bash | |
set -e | |
curl https://sh.rustup.rs -sSf | sh -s - --default-toolchain nightly -y | |
source ~/.cargo/env | |
rm -rf target/ | |
cargo doc --quiet --no-deps --all-features --document-private-items >> /dev/null |
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
#!/usr/bin/env bash | |
set -e | |
mdbook=https://github.com/rust-lang-nursery/mdBook/releases/download/v0.2.1/mdbook-v0.2.1-x86_64-unknown-linux-gnu.tar.gz | |
curl -Lo mdbook.tar.gz $mdbook | |
tar -xzvf mdbook.tar.gz | |
chmod u+x mdbook | |
./mdbook build |
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
use std::{ | |
f32, | |
io | |
}; | |
use minifb::{ | |
Key, | |
WindowOptions, | |
Window, | |
}; | |
use vek::*; |
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
use std::f32; | |
use minifb::{ | |
Key, | |
WindowOptions, | |
Window, | |
}; | |
use vek::*; | |
const W: usize = 64; | |
const H: usize = 64; |
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
#!/usr/bin/env bash | |
set -e | |
mdbook=https://github.com/rust-lang-nursery/mdBook/releases/download/v0.2.1/mdbook-v0.2.1-x86_64-unknown-linux-gnu.tar.gz | |
curl -Lo mdbook.tar.gz $mdbook | |
tar -xzvf mdbook.tar.gz | |
chmod u+x mdbook | |
curl https://sh.rustup.rs -sSf | sh -s - --default-toolchain nightly -y |
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
unsigned char SA[1024], SB[1024], SC[1024]; | |
unsigned char *sa = SA, *sb = SB, *sc = SC, *tmp; | |
int cp = 0; | |
int main(int argc, char **argv) { | |
char* code = "$+$+$+[$-!$+$+$+$+!!]![$-!!$+$+$+$+$+$+!]!!.$-$-$-.$$$$$$$+++++++..$$$+++.[$-]$+$+[$-!$+$+$+$+$+!!]!."; | |
while (*code != '\0') { | |
switch (*code) { |