Skip to content

Instantly share code, notes, and snippets.

View eribertto's full-sized avatar

Eriberto Mendz eribertto

View GitHub Profile
@eribertto
eribertto / rs
Created July 4, 2021 11:57
enums3.rs
// enums3.rs
// Address all the TODOs to make the tests pass!
// I AM NOT DONE
enum Message {
// TODO: implement the message variant types based on their usage below
Move {x: i32, y: i32},
Echo (String),
ChangeColor (i32, i32, i32),
@eribertto
eribertto / rs
Created June 27, 2021 07:50
Calculator in Rust
// simple calculator app in Rust
use std::io::{stdin, stdout, Write};
// create a function
fn read(input: &mut String) {
stdout().flush().expect("failed to flush");
stdin().read_line(input).expect("failed to read");
}
fn main() {