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
#![feature(proc_macro_hygiene)] | |
use inline_python::python; | |
use rodio::Sink; | |
fn main() { | |
let device = rodio::default_output_device().unwrap(); | |
let sink = Sink::new(&device); | |
let c = inline_python::Context::new(); | |
let file_path = "/path/to/file.flac"; |
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
//! High-level types and functions related to CSS parsing | |
use std::{ | |
num::ParseIntError, | |
fmt, | |
}; | |
pub use simplecss::Error as CssSyntaxError; | |
use simplecss::Tokenizer; | |
use css_parser; | |
pub use css_parser::CssParsingError; |
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
//A program for the r/dailyprogrammer challenge #353 [Intermediate], done using Rust. | |
use std::io; | |
fn main() { | |
println!("Let's get the pancakes sorted!"); | |
println!("----"); | |
loop { | |
let num: usize = get_input().parse().expect("Enter only numbers"); | |
let pancakes = get_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
//A program for the r/dailyprogrammer challenge #366 [Easy] Word Funnel 1, done using Rust. | |
use std::fs::File; | |
use std::io; | |
use std::io::prelude::*; | |
use std::time::Instant; | |
fn create_dictionary(filename: &str) -> io::Result<Vec<String>> { | |
let file = File::open(&filename)?; | |
let reader = io::BufReader::new(file); |
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
//A program for the r/dailyprogrammer challenge #361 [Easy] Tally Program, done using Rust. | |
use std::io; | |
#[derive(Debug)] | |
struct ScoreCard { | |
a: i32, | |
b: i32, | |
c: i32, | |
d: i32, | |
e: i32, |
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
//A solution to the r/dailyprogrammer challenge #221 [Easy] Word Snake, done using Rust. Only goes right and down. | |
use std::io; | |
fn main() { | |
println!("Word Snake"); | |
println!("Please enter a sentence"); | |
let mut sentence = String::new(); | |
io::stdin().read_line(&mut sentence) | |
.expect("Failed to read line"); | |
sentence = sentence.trim().to_string(); |
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
0.00 | D' F L F D2 L D' L' U B L2 B' D R2 D L2 F' R' D F2 | |
---|---|---|
0.00 | L' D L' D' L' U' R2 B2 L B D F2 L' D B' U2 L2 U2 L B2 | |
0.00 | U2 B' U B' L U2 F2 D R2 D2 F' L2 D R2 D' L F' L' D2 F2 | |
0.00 | R' F2 U B L F R' B' U B' L' U L2 B2 D' R' D2 B2 U B | |
0.00 | F' R2 U' F' U2 F' L F2 D2 L2 D' B D L' B R2 B2 D L' F | |
0.00 | B' U B R U F2 U2 B' U' R' B D R B2 U2 B2 R' B2 D' R | |
0.00 | L' B L U2 R B2 U' R2 U2 B2 U' F' L2 U2 F' R2 D2 L B U' | |
0.00 | F U' B2 D L' U2 F' U L U' B R' D' F2 L' B U2 F' U2 F | |
0.00 | L2 D' F2 U' L U L B' L2 D2 B' L U' F' U' R2 B2 D B L' | |
1.07 | B D' F2 U' R2 D' R' B2 U F' R' U R' F2 D' F' U R D2 R2 |