day09 remove class crap
This commit is contained in:
@ -1,20 +1,5 @@
|
||||
import fs from 'node:fs'
|
||||
|
||||
class Block {
|
||||
constructor() {
|
||||
this.Id = BigInt
|
||||
this.Size = BigInt
|
||||
|
||||
}
|
||||
}
|
||||
class Disk {
|
||||
constructor() {
|
||||
this.Map = [{}]
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function init(filename) {
|
||||
const data = fs.readFileSync(filename, { encoding: 'utf-8' }, data => data)
|
||||
const diskmap = [...data.split('')].map((sector, index) => index % 2 === 0 ? ''.padStart(sector, index / 2) : ''.padStart(sector, '.')).join("")
|
||||
|
Reference in New Issue
Block a user