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)); |
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
<!-- 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
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
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
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
package main | |
import ( | |
"github.com/nsf/termbox-go" | |
) | |
func DrawPoint(x, y int, color termbox.Attribute) { | |
termbox.SetCell(x, y, ' ', termbox.ColorDefault, color) | |
} |
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
This is a conversation between ok and yourself, aesl. | |
ok: WAT | |
aesl: minimal | |
aesl: I like it | |
aesl: whatcha doin "ok" | |
ok: did you just assume what i am doing? | |
ok: please don't do that | |
ok: >:( | |
aesl: sorryyyy | |
aesl: i did not mean to offend you |
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
// This was actually the first implementation I wrote. I made | |
// this and decided I should try writing the same algorithm in | |
// Zig for learning the language. After I was done I found it | |
// interesting the differences in how they accomplish the same | |
// thing. I thought it'd be neat to write this algorithm in more | |
// languages just for science. | |
// | |
// The algorithm is very simple. Essentially you give it a string | |
// and it replaces every vowel with exclamation marks and returns | |
// the new one. |
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
RifToday at 12:21 PM | |
Hi, about that message I sent yesterday in the coding server, I know basics and some functions in c++, but I don't know how to use it on Unity and which functions are more useful, currently I wanted to learn how to structure an RPG and some tips on how to make a bullet hell work. | |
aeslToday at 12:24 PM | |
Okay, well I can give you a quit direction to follow. You will probably have trouble using C++ as your language in unity since it may not have bindings (look up "Unity C++ bindings"), so C# may be a good option instead. In order to even get your C++ code to be executed by your C# code (you have to probably call your C++ from a tiny C# script), your C++ must be compiled to a dynamic library most likely (a .dll file on windows) or possibly, if you're lucky, a static library (or .lib on windows) | |
That's the quick guide on how to do that | |
but I've never used C++ with Unity before, I know for a fact that it is possible. just either it will be tricky or easy | |
RifToday at 12:25 PM | |
What are the differe |
OlderNewer