Skip to content

Instantly share code, notes, and snippets.

@scpchicken
scpchicken / bruh.rs
Created April 22, 2022 15:46
rust template for spring 2022 codingame
use std::convert::TryFrom;
fn main() {
let [
base_x, // The corner of the map representing your base
base_y
] = <[i32; 2]>::try_from(input_vec()).ok().unwrap();
let heroes_per_player = input!(usize); // Always 3
@scpchicken
scpchicken / bruh.rs
Last active April 22, 2022 15:21
slightly better rust 2022 spring starting code
use std::convert::TryFrom;
fn main() {
let [
base_x, // The corner of the map representing your base
base_y
] = <[i32; 2]>::try_from(input_vec()).ok().unwrap();
let heroes_per_player = input!(i32); // Always 3
@scpchicken
scpchicken / a_python_like_print_in_c++
Last active April 8, 2021 13:12
C++ Class to simulate python like print (struct works too)
C++ Class to simulate python like print (struct works too)
Note:
- Must use curly brackets if you are using a single variable type
- Curly brackets and Regular brackets both work in any other case