Created
March 7, 2022 20:06
-
-
Save killroy42/8c72406ec34ba72cb1f59edcd77d0927 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
// Exmaples to convert f-puzzles URL to CTC url and extract CTC JSON | |
// Paste in console on ctc app site to load libraries | |
await (async () => { | |
// f-puzzles URL to CTC JSON | |
const fpuzzlesUrlToCtcJson = async url => JSON.parse(PuzzleZipper.unzip(await loadFPuzzle(url.replace(/.*?fpuzzles(.*)/, '$1')))); | |
// f-puzzles URL to CTC URL | |
const fpuzzlesUrlToCtcUrl = async url => `https://sudokupad.app/ctc${loadFPuzzle.compressPuzzle(await loadFPuzzle(url.replace(/.*?fpuzzles(.*)/, '$1')))}`; | |
// Sample: | |
let url = 'https://sudokupad.app/fpuzzlesN4IgzglgXgpiBcAmAjAGhAcwE4QCYIG0DgBfVU8si6q2y+mhuxl2gXVWOe6d9b579SHLgLFDBk8SRETp8uYpmclCqataz12tbppa9OjdoPHD5/SqPWLk0zbOP2V26+P23D6x6efpPrz8JAKDAzRdfSO8IsNi1EKjQygS4xMtRNNS7GKTM5LYSIA='; | |
console.log('url:', url); | |
console.log('fpuzzlesUrlToCtcUrl:', await fpuzzlesUrlToCtcUrl(url)); | |
console.log('fpuzzlesUrlToCtcJson:', await fpuzzlesUrlToCtcJson(url)); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment