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
diff --git a/src/mame/cave/cv1k.cpp b/src/mame/cave/cv1k.cpp | |
index c57694f92aa..14865cc0b5b 100644 | |
--- a/src/mame/cave/cv1k.cpp | |
+++ b/src/mame/cave/cv1k.cpp | |
@@ -917,32 +917,32 @@ ROM_START( dfkbl ) | |
ROM_LOAD16_WORD_SWAP( "u24", 0x400000, 0x400000, CRC(31f9eb0a) SHA1(322158779e969bb321241065dd49c1167b91ff6c) ) | |
ROM_END | |
-// ROM_START( akatana ) | |
-// ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF) |
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
const input = await Deno.readTextFile("input.txt"); | |
type Position = { x: number; y: number }; | |
type Direction = "up" | "down" | "left" | "right"; | |
type Guard = { | |
position: Position; | |
direction: Direction; | |
}; |
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
const input = await Deno.readTextFile("input.txt"); | |
type Rule = { | |
x: number; | |
y: number; | |
}; | |
const [order, pages] = input.split("\n\n"); | |
function parseRules(rules: string): Rule[] { |
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
const input = await Deno.readTextFile("input.txt"); | |
const directions = [ | |
[0, 1], | |
[0, -1], | |
[1, 0], | |
[1, 1], | |
[1, -1], | |
[-1, 0], | |
[-1, -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
const input = await Deno.readTextFile("input.txt"); | |
function matchMuls(str: string): string[] { | |
return str.match(/mul\(\d+,\d+\)/g) || []; | |
} | |
function calculateMulSum(arr: string[]): number { | |
return arr.reduce((acc, str) => { | |
const [a, b] = str.slice(4, -1).split(",").map(Number); | |
return acc + a * b; |
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
const input = await Deno.readTextFile("input.txt"); | |
const data = input.split("\n"); | |
let left: number[] = []; | |
let right: number[] = []; | |
for (const pair of data) { | |
const [a, b] = pair.split(" "); | |
left.push(+a); | |
right.push(+b); |
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
const input = await Deno.readTextFile("input.txt"); | |
const data = input.split("\n"); | |
const isSafe = (levels: number[]): boolean => { | |
const diffs = levels.slice(1).map((num, idx) => num - levels[idx]); | |
// Stupid off by one error >:( | |
if (diffs.length === 0) { | |
return false; | |
} |
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
const fetcher = async (path, options = {}) => { | |
const response = await fetch(path, options); | |
if (!response.ok) { | |
throw new Error(`HTTP error! status: ${response.status}`); | |
} | |
const data = await response.json(); | |
return data; |
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 job queue that takes an anonymous functions and executes them in parallel | |
let maxConcurrent = 3; | |
let queue = []; | |
let activeCount = 0; | |
// Add task to queue and execute | |
async function exec(task) { | |
queue.push(task); | |
await next(); | |
} |
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 job queue that takes an anonymous functions and executes them in parallel | |
class JobQueue { | |
constructor(maxConcurrent = 3) { | |
this.maxConcurrent = maxConcurrent; | |
this.queue = []; | |
this.activeCount = 0; | |
} | |
// Add task to queue and | |
exec(task) { |
NewerOlder