This file contains hidden or 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
while { | |
let x = foo(); | |
bar(x); | |
x != 0 | |
} {} | |
This file contains hidden or 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. type Foo = struct { X | Int, Float, Array[X]} | |
2. type Foo = struct {X ; Int, Float, Array[X]} | |
3. type Foo = Struct[X; Int, Float, Array[X]] | |
4. type Foo = struct [X; Int, Float, Array[X]] | |
5. type Foo = struct X, Y { Int, Y, Array[X] } | |
1. type Foo = struct { | |
X | | |
Int, | |
Float, |
This file contains hidden or 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
pub(crate) struct CaptchaIter<T> { | |
state: IterState, | |
source: T, | |
} | |
impl<T: Iterator<Item = u8>> CaptchaIter<T> { | |
pub fn new<S>(source: S) -> Self | |
where | |
S: IntoIterator<Item = u8, IntoIter = T>, | |
{ |
This file contains hidden or 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(universal_impl_trait)] | |
// DO NOT FORGET: | |
// Y == VERTICAL | |
// X == HORIZONTAL | |
const TARGET: i32 = 325489; | |
fn main() { | |
println!("{}", first_larger(TARGET)); |
This file contains hidden or 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(test)] | |
#[cfg(test)] | |
extern crate test; | |
extern crate fxhash; | |
extern crate rayon; | |
static INPUT: &str = include_str!("../input.txt"); |
This file contains hidden or 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
using System; | |
using System.Collections.Generic; | |
using System.Diagnostics; | |
using System.Linq; | |
namespace cs_day_4 | |
{ | |
class Program | |
{ | |
static void Main(string[] args) |
This file contains hidden or 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
static INPUT: &str = include_str!("../input.txt"); | |
struct ProgramWithOffset<F> { | |
instructions: Vec<i32>, | |
offset: F, | |
} | |
impl<F: Fn(i32) -> i32> ProgramWithOffset<F> { | |
fn new<T: IntoIterator<Item = i32>>(instructions: T, offset: F) -> Self { | |
Self { |
This file contains hidden or 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(conservative_impl_trait)] | |
const INPUT: &str = include_str!("../input.txt"); | |
fn main() { | |
println!("{}", run_program(read_input(), |i| i + 1)); | |
println!("{}", run_program(read_input(), offset)); | |
} | |
fn offset(i: i32) -> i32 { |
This file contains hidden or 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
using System; | |
using System.Collections.Generic; | |
using System.Diagnostics; | |
using System.Linq; | |
namespace AocDay5 | |
{ | |
class Program | |
{ | |
class Resources |
This file contains hidden or 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(test)] | |
extern crate fxhash; | |
extern crate test; | |
#[derive(Clone, Eq, PartialEq)] | |
struct MemoryBank { | |
banks: Vec<i32>, | |
} |