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
| extends Camera | |
| func shake(length, magnitude): | |
| var time = 0 | |
| var camera_pos = translation | |
| while time < length: | |
| time += get_process_delta_time() | |
| var offset = Vector3() | |
| offset.x = rand_range(-magnitude, magnitude) |
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
| fn main() { | |
| println!("| {:^5} | {:>3} | {:>4} | {:03} |", "Char", "Dec", "Hex", "Oct"); | |
| println!("|-------|-----|------|-----|"); | |
| for c in 0u8..128u8 { | |
| println!("| {:^5} | {:>3} | {:>#4X} | {:03o} |", get_char_name(c), c, c, c); | |
| } | |
| } | |
| fn get_char_name(c: u8) -> String { | |
| assert!(c < 128); |
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
| import "core:fmt.odin" | |
| interpret :: proc(program: string) { | |
| tape: [30000]u8 = 0; | |
| ptr := 0; | |
| index := 0; | |
| for index < len(program) { | |
| switch program[index] { |
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
| <!-- Preprocessor --> | |
| <!-- | |
| In this form, the preprocessor presented is LaTeX code, | |
| that is specific to the LaTeX backend only. | |
| Every backend will have to have its own implementation for preprocessor. | |
| The preprocessor can be used for things like scripting environment variables, page numbers, and more. | |
| --> | |
| @title Hello World |
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
| // "Hello, world!" | |
| static PROGRAM: &'static str = "++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++..+++.>>.<-.<.+++.------.--------.>>+.>++."; | |
| fn main() { | |
| let tokens = tokenize(PROGRAM); | |
| //println!("{:?}", tokens); | |
| let generated_code = generate(&tokens); | |
| println!("{}", generated_code); | |
| } |
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
| extern crate rayon; | |
| use std::io::{stdout, Write}; | |
| use std::net::{IpAddr, Ipv4Addr, TcpStream}; | |
| use rayon::prelude::*; | |
| static MAX_PORT: u16 = 65535; | |
| fn main() { | |
| let address = IpAddr::V4(Ipv4Addr::new(127, 0, 0, 1)); |
NewerOlder