Skip to content

Commit

Permalink
Update Aoc1608.tsx
Browse files Browse the repository at this point in the history
  • Loading branch information
nuoxoxo authored Sep 20, 2023
1 parent 0356990 commit 7e1bccd
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/includes/Aoc1608.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ var Aoc1608 = () => {
const [p2Traces, setP2Traces] = useState<string[][][]>([])

const handleData = async () => {

try {
const raws = isTest
? ['rect 3x2', 'rotate column x=1 by 1', 'rotate row y=0 by 4', 'rotate column x=1 by 1']
Expand All @@ -32,7 +33,6 @@ var Aoc1608 = () => {

const Solver = () => {


let grid:string[][] = []
let traces:string[][][] = []
let i, j
Expand All @@ -51,8 +51,6 @@ var Aoc1608 = () => {

let arr:string[] = line.split(' ')
let cmd = arr[0] // rotate OR rect


if (cmd === 'rotate') {
cmd = arr[1] // columm OR row
let pos = parseInt(arr[2].split('=')[1]) // '2' in 'y=2' // BUG found and fixed
Expand Down Expand Up @@ -92,9 +90,7 @@ var Aoc1608 = () => {
let temp:string[] = arr[1].split('x')
let a = parseInt(temp[0])
let b = parseInt(temp[1])

// console.log(line, cmd, a, b) // TEST parsing

i = -1
while (++i < b) {
j = -1
Expand Down

0 comments on commit 7e1bccd

Please sign in to comment.