Skip to content

Instantly share code, notes, and snippets.

View andras-gyarmati's full-sized avatar
🐧
Noot noot

Gyarmati András andras-gyarmati

🐧
Noot noot
View GitHub Profile

Rust Cheat Sheet

Variables & Mutability

Variables are immutable by default. This makes Rust safer and makes concurrency easier.
Immutable means once a value is bound to that variable, it cannot be changed.
For example:

fn main() {
 let x = 5;
@beesandbombs
beesandbombs / twistingLines.pde
Created April 25, 2018 13:14
twisting lines
int[][] result;
float t, c;
float ease(float p) {
return 3*p*p - 2*p*p*p;
}
float ease(float p, float g) {
if (p < 0.5)
return 0.5 * pow(2*p, g);