This file contains 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
use std::io::{self, Write}; | |
use std::{fmt::Display, str::FromStr}; | |
type Result<T> = std::result::Result<T, Box<dyn std::error::Error>>; | |
struct Board { | |
contents: Vec<Option<char>>, | |
width: usize, | |
height: usize, | |
} |
This file contains 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() { | |
for i in 1..=100 { | |
match (i % 3, i % 5) { | |
(0, 0) => println!("CracklePop"), | |
(0, _) => println!("Crackle"), | |
(_, 0) => println!("Pop"), | |
_ => println!("{}", i), | |
}; | |
} | |
} |
This file contains 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
#!/usr/bin/env bash | |
# tictactoe.sh - tictactoe in bash for fun | |
# | |
set -eu | |
board=" " | |
turn="X" | |
print_board() { |