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
date time | | |
2025-01-25 15:03:34.954 | arguments: ./dosbox | |
2025-01-25 15:03:34.954 | Current dir: /home/daniel/code/dosbox-staging/build/release | |
2025-01-25 15:03:34.954 | stderr verbosity: 0 | |
2025-01-25 15:03:34.954 | ----------------------------------- | |
2025-01-25 15:03:34.954 | dosbox-staging version 0.83.0-alpha () | |
2025-01-25 15:03:34.954 | --- | |
2025-01-25 15:03:34.954 | LOG: Loguru version 2.1.0 initialised | |
2025-01-25 15:03:34.957 | CONFIG: Loaded primary config file '/home/daniel/.config/dosbox/dosbox-staging.conf' | |
2025-01-25 15:03:34.957 | LOCALE: Using internal English language messages (detected from 'LANG=en_US.UTF-8') |
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
org 100h | |
section .text | |
; open file | |
mov ah, 3dh | |
mov al, 0h | |
lea dx, [file_name] | |
int 21h | |
jc open_error_fn |
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::ops::{Add, AddAssign}; | |
#[derive(Clone, Copy)] | |
enum Direction { | |
Up, | |
Down, | |
Left, | |
Right | |
} |
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
struct Equation { | |
result: u64, | |
ops: Box<[u64]> | |
} | |
fn parse_input() -> Vec<Equation> { | |
let mut eqs = Vec::new(); | |
for line in std::fs::read_to_string("input").unwrap().lines() { | |
let (r, o) = line.split_once(':').unwrap(); | |
let result: u64 = r.parse().unwrap(); |
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::collections::{HashSet, VecDeque}; | |
const WALL: u8 = 128; | |
const EMPTY: u8 = 64; | |
const POS_MASK: u64 = 0x00000000ffffffff; | |
const HERB_MASK: u64 = 0xffffffff00000000; | |
struct Grid { | |
width: u64, |
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
struct Grid { | |
width: usize, | |
height: usize, | |
data: Vec<u8> | |
} | |
fn get_grid() -> Grid { | |
let mut grid = Grid { | |
width: 0, | |
height: 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
#[derive(Default)] | |
struct Map { | |
dst: u64, | |
src: u64, | |
range: u64 | |
} | |
#[derive(Default)] | |
struct Seed { | |
start: u64, |
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
#include <fcntl.h> | |
#include <stdbool.h> | |
#include <stdio.h> | |
#include <stdint.h> | |
#include <stdlib.h> | |
#include <unistd.h> | |
#include <sys/stat.h> | |
#include <string.h> | |
#define BLIZZARD_LEFT 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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <stdint.h> | |
#include <time.h> | |
static long read_digit(char c) | |
{ | |
switch (c) { | |
case '-': | |
return -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
#include <stdbool.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <stdint.h> | |
#define EMPTY 0 | |
#define LAVA 1 | |
#define WATER 2 | |
#define BOUNDS 3 |
NewerOlder