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
# State zero, move north if nothing to north else move west | |
0 x*** -> N 0 | |
0 N*** -> X 1 | |
# Move west state | |
# If nothing to the west move West | |
# If end of row move south then east | |
# If at top left corner move East | |
# If at bottom left corner do nothing | |
1 **x* -> W 1 |
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 encrypt_decrypt(plaintext: &str, key: usize) -> String{ | |
let alphabet = "ABCDFGHIJKLMNOPQRSTUVWXYZ"; | |
let plaintext = &plaintext.to_uppercase(); | |
let mut ciphertext = String::from(""); | |
//println!("{}", plaintext); | |
//MORINGA | |
for each_char in plaintext.chars(){ | |
//println!("char {}", each_char); |
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
extern crate reqwest; | |
#[macro_use] | |
extern crate hyper; | |
use hyper::header::{Accept, Headers}; | |
header! {(Apikey, "apikey") => [String]} | |
fn send_request(url: &str, apikey: String) -> Result<reqwest::Response, reqwest::Error> { | |
let mut headers = Headers::new(); |
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
extern crate image; | |
use std::fs::File; | |
use std::path::Path; | |
fn main(){ | |
let image_size = 300; | |
let mut image_buf = image::ImageBuffer::new(image_size, image_size); | |
let red = [255, 0, 0]; |
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; | |
fn main() { | |
//nth fibonacci number generator | |
loop{ | |
println!("Enter position of fibonacci you want."); | |
let mut pos = String::from(""); | |
io::stdin().read_line(&mut pos) | |
.expect("Could not read input."); |
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; | |
fn main() { | |
println!("Hello there user,"); | |
loop{ | |
println!("Which units will you be converting from F or C? (type q to quit):"); | |
let mut unit = String::new(); | |
io::stdin().read_line(&mut unit) | |
.expect("Could not read input."); |
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
import turtle | |
def main(lString): | |
wn = turtle.Screen() | |
kurt = turtle.Turtle() | |
scheme = makeLSystem(lString) | |
drawLSystem(kurt, scheme) | |
def makeLSystem(lString, times=5): |
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
44 71 | |
79 37 | |
78 24 | |
41 76 | |
19 12 | |
19 32 | |
28 36 | |
22 58 | |
89 92 | |
91 6 |
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
import sys | |
import random | |
def main(): | |
generate_sudoku() | |
initial_state = load_sudoku() | |
sudoku = Sudoku(initial_state) | |
print(sudoku) | |
def generate_sudoku(): |
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
[[1,2,3],[4,5,6],[7,8,9]].map(row=> row.map((el, i) => i < 2 ? el - 1 : el)) |
OlderNewer