Posts for squilibob

Published Author, Player (25)
Joined: 1/10/2023
Posts: 1
Location: Brisbane
LogansGamingRoom wrote:
what javascript did you write for this TAS? i want to use it for the Uzebox Sokoban games.
I'm not sure how much it would help you. I took the output from the sokoban solver and converted the directions to a text file that TAS Studio could read. I am going to post all of it here if it fits, there was another loop that iterated all of the levels but I deleted it while testing something on the final level. All the parsing code is there though:
import { promises } from 'fs'
const blank = `|..|............|............|
`
const direction = {
	u: `|..|U...........|............|
`,
	d: `|..|.D..........|............|
`,
	l: `|..|..L.........|............|
`,
	r: `|..|...R........|............|
`,
}

let levels = {
	8: 'llLdLLUdLrrruLLLrrrrruulllDLddrruLLrrrrdLLLL',
	20: 'lLLuullddRDDldRRuluuluurDDDDldRuuuurRdLulDDDuurrrruLLLulDDDuullldRRDDRRluluurDDldR',
	30: 'UrurDrDrDrDDurDluuUrUUddDDuullURdrUlUdllllldDDurDuUUdRDDuRDRUlURdrDuUUlLdlUddlllUUdlDlDlDuruUlUUddrrULdlUlUdrdDDulDDuurrrrDLLLulDuUU',
	// 30: 'UruLdlDrururDllldlDlDururrurrrDrUdDuullllldlUrrrrrrddrDDuuluulllldDDuuurrrrddrdrDululuurUdlllllllddldlDurururrurrrrddrddLLLrrruuluullllllddlUlUUdlUrdRRRdrUllldddlUlUdrrrurrurrrrrDullllllllddlddlUrrururrurrrrrdrDuluurDllllllllllDlUrrrrrrrrrrdDrUUUldlllllddrUluRRRRRdrUddDulDuullLLLLLdlUruLdlUrrrrrrdDDuulllllllDDDrurururrrrdRRurrddlUUruLLLLLLLLLrrrrrrddDurrdLuullllllllluRRRRRRurDrdLLLLLLrdRRRRRRdrUUUllllllddDuuulllldRRRRRdrUUrdddRurDullllllldlUUluRRRRRRdrUllldddLLLulDrrrrrurrdLLLLLulD',
	40: 'lDDrrDDlLrruulluurrDDDullDDrRllulllddrURlluRRdRUUrrddLLLururruullDDDldRullldRurrurruLulDD',
	48: 'dlLdlluRRdddrrUULLulldRururrD',
	58: 'llluuurrRRRRRRRlllllluuurrrdrrrUdlllulldlddrrrrrrdddrrUUddlluuulllllluuurrrdrrrurrrddlUUlldlllulldlddrrrrrrdddrruuUUruullldlllLLrrrrrurrrddlddddlluuulllllluUruLLdlUruLdrrruuurrdLulDDDrdLrrrrrurrrddlddddlluuulllllluUruLLdlUUdrrruuurrrrrdLLLLulDDDrdLrrrrrurrrddlddddlluuulllllluUruLLdlUrrruurrrrrDulldRulllldddrrrrUUluurrdLLLLulDDDrdLLLrddrrrrrrdddrruuuuruullLdlllulluurrrdrDrdLLLLLrrrrurrrrddlddddlluuulllllluUruLdlUUUddrruurrrrrDlddlllllddrrrrrrdddrruuuuruullLulDrdLLLLLrrrrurrrrddlddddlluuulllllluUruLdlUUddrrrrrrurrrrddlUruLLLulDrdLLLLLrrrrurrrddddddlluuulllllluUruLdlUdrddrrrrrrRldddrruuUUUruLLLulDrdLLLLLLddlldlddrUUluRRRRRRRRRRldddrruuUUUruLLLulDrdLLLLullddddLullddrUluRRdrUUdrrrrrrrruuuruulDrdLLLdlUUruLLLLulDDurrrdrddllulLLLLrrrrdrrrurrrdddlldRlddrruUUUUruLLLdlUUruLLLLulDDurrrdrddllulLLLrrrdrrrurrrdddllllldlddrUUluRRRRRdrUUUruLLLdlUUruLLLLulDDurrrdrddllulLLrrdrrrurrrdddlllllddrUluRRRRdrUUUruLLLdlUUruLLLLulDDurrrdrddllulLrdrrrurrrddddddlUUluRdrUUUruLLLdlUUruLLLLulDD',
	60: 'rdDllldllDDDrRurRdddLdRRRRRRurrruuuuLLdllDurrRurDDDrdLLLulLuuuLLdRurDDDDDlllllllUlldRRRRRRluuuuRRRurDDDrrdDlUdlldlUUrRuuulllllldlDDldRRRRRlllluuuluuurrurrrRDDuuluurDrrDDDDDDDllDlluuuurRRurDDDRDLLddRUluRuuulllllldRllluRRRRDDDldRRRlluuuuRRRurDDDDDRUluuuuuuullDDulldRDRluurRurDDDDDDDlDRllllllluuulDDldRRRRRRRllluLLulDldRRRRRRluuuuRRRRRRRurDDDrdLLLLLuuuuuullDDldRRRRRRurDDDrdLLLrruuuullLdllluuurrdDDDDDuuulluRluurrdDDDDuuuuurRurrdLLLruLLLrDDDDDuuuullluurDDDDldRRRRRRurDDDrdLL',
	70: 'urrrddddLLLLLLLLLLLddrrrrrUdlllllllddrUluRRRdLullddrUluRdrUUUUdrrrrRRRRRurrdLLLLLLLLLLrrrrddllLLLuUruLLuRddrrrrrrrrrddlUruLLLLLLLLrrrrddllllluUruLddddlluRdrUUULURuLuurrrurrdLLLLulDDDuurrrrrrrddlUruLLLLLLulDDurrrrrrrddDrdLLLLLLrrrrddlldLLLuuUUdddllddrUluRdrUUUrrrrrrrrrrruuuullDlLLrrrDDrruLddLLLLLLLLLLrrrrrruuurrrDDrdLLLLLLLLLrrrrrrrrrrdLLdlUruLLLLLLLrrrruulUruLLLLLLulD',
	78: 'luuUruLLdrdddrruLdrrruLLdllUUUlldRurrurrdDlddlluUluuRRllddrUluRddddrrrUUUddlLdlUUUdddlUUU',
	88: 'ruulUruulLLdlddrUUddlddrUUURRUddrUUddddlUUUddLUdLdlUUUrRRdrU',
	100: 'uUruuuurrdrRddLDlddrUUlUUUUluRddrrddLdlUUUUUUUlllLulldRRRRRuRRdLulDlllDDDDDlddRUUUUUURuLulldRRRRRDrUdddlldRlddLDlUUUUUUrurruRddddDrrddllUUUUUUddddrrdrrruulDLLLrddlluUUUUlLulLulldRRRRdrURddddrrrrrdLLulllddrrUruLLrddlluUUUUdddrrrrruuruulldDDrdLLLLrddlluUUUdddddddrrruurUUruLLLLrddlluUUddddddlllUUruLdlUUUUUURRulLulldRRRR',
	110: 'uRRRururuuluuuulDrdddDlLdLddrrurUruLddldlluuruuLDLLLLulDrrrrruuUluurDDDDrdLLLLLLrrruRdrUUUluurDDDDrdLLLLLullDDRUrrrrruuuuRRurDDDDrddlULLLLLLLLrrrrruuuurrrddlUrdDrdLLLLLLLLDllUURDDurrrrrrrrddldlluUruLLLLLdlUrrrdRurrrrddldlluUruLLLLLULDrrrrruuuurRurDDDDrdLLLLLLLLLrrrrrdddrrdrUUUruLLLLLLLLdLUU',
	120: 'lDDDrddLddLLulULLLLLdddRdrruulLdlUUUruLLLdllddrRRdrUUUUruLddLLrrrrrrrUUlDrdLLLLLdddrdrUruLLdlUUUUUruLLuuurrrdDDDuuuurrdDDDDrdLLLLrrrrdrddlLLLdlUluuUruLLUULdlllldddRluuurrrrrrdddddrruLdlUUUUUddrrrrrdrdrrdLLLLrULLLLdlUUUruLddddrrdrUruLLLdlUUUUdrrrrrDrdLLLLLdlUUULURdrrrruuuuuLulDDDlLLDRddrrrrDrdLLLLdlUUUUUluRdddddllllUUUddlluuurRRRlldddddrRRRRdrUruLLdlUUUUUddddrrrrrrrruLLLrrruULLLulDuuurDDDDLLLLrrrrDrdLLLLLLuUUdrrrrrurruULLrrrDuuulDLuLLLrdDDDrdLLLLLrrrrrurruruLLuLDDDrrDDrdLLLLLLLdlUUUddLLLdlUUUUddlluuurRRluuurrrDuurrrDDurrDDDDrDLLLLrrrrurrurrdLLLLulDrdLLLrrrDrdLLUruLLrddLLLLLLLdlUUUUddlluuurR',
	128: 'lluurrrrrrdDuullllllddrrRRRRRRRdrUUruLddlllluullllDullddrRRRRRRRRdrUUdlllluullDullddrRRRRRRRllllllllDDLLddrrrruuUdddllUUUUrRRRRRRdrrUUlDrdLrrrddllllllluUUlluurrDullddrRRRRRurrrurrddLruLLLLDlllllllllddRlddrruUUdlluurRRRRRRRdRUllldRulllllllddddlllluuRRRRRlddrruUUdlluurRRRRRRRlllllluullDullddrRRRRRRRRllldddrrrrrrruuLrUruL',
	138: 'rDrrddlUdrddlUUdlLuLrRdldRurrddlUruLLrruuuLLullDllddddrRRRurrddlUruuuullDDuuulldRurD',
	148: 'lLdLdRuuuLDrrruLdlluulldDRRRddlllUdrrUruRuuLrdrrdLdLrdLL',
	160: 'DLLuullddLLuuLrddrruurrddLruulldLdlLURuRRdRdLLrrrrruULDruUruullllllllllldddddddrrrrrrrrrrUULrddllllllllllddrrUdlluuuuuuuuurrdLulDDDDDDDuuuuuuurrrrdLLLulDDDDDuuuuurrrrrrdLLLLLulDDDDuuuurrrrrrrrdLLLLLLLulDDDuuurrrrrrrrrrrddlULLLLLLLLLulDDurrrrrrrrrrddlddrUUUruLLLLLLLLLLulDrrrrrrrrrrddddddlllllllLLrddrrrrrrrrUUUUUUUruLLLLLLLLLLrrrrrrrrrddddddddllUdlllllluurrDurrrRRlddrruUUUUUddddddllllUdlLLLLrrruurRRRRlddrruUUUluurDDuuUruuLLLLLLLLLLrrrrrrrrrDDDlddrUdlLLululldRRldRRllulldRRR'
}
let copypaste = levels[160]
console.log(copypaste.length)

copypaste = copypaste
	.toLowerCase()
	.split('')
	.map(letter => direction[letter])
	.join(Array(17).fill(blank).join(''))
promises.writeFile('test.txt', copypaste)