Live data from Hacker News

Infinite Craft

neal.fun

491–500 of 831 posts

Re: Infinite Craft

#492

The game state clears on reload, so here's a wee console snippet to export your list of elements: console.log(JSON.stringify({discoveries: window.$nuxt.$root.$children[2].$children[0].$children[0]._data.discoveries, elements:window.$nuxt.$root.$children[2].$children[0].$children[0]._data.elements})) I'll figure out how to re-import the state later, but it's past midnight for me now.

The state can be re-imported like this: ``` a = (insert JSON output here) window.$nuxt.$root.$children[2].$children[0].$children[0]._data.elements = a.elements; window.$nuxt.$root.$children[2].$children[0].$children[0]._data.discoveries = a.discoveries; ```

Re: Infinite Craft

#493
post #453

Earlier quoted context omitted.

Great point.

I got “edward” after linking “vampire” and “eclipse” so yeah.

Not sure if this is the point you're making, but that is probably due to "Edward Cullen" of Twilight.

Re: Infinite Craft

#497
I just don't have enough time to do it manually. Writing a little script that automates crafting was quicker for me. It found me "Star Trek: The Rockapocalypse"

    const sleep = (ms) => new Promise(resolve => setTimeout(resolve, ms)); 
    
    let elements = [
        ' Water',
        ' Fire',
        ' Wind',
        ' Earth'
    ];
    
    let pairs = {};
    
    async function getResponse(left, right) {
        const url = `https://neal.fun/api/infinite-craft/pair?first=${left}&second=${right}`;
        return await (await fetch(url)).json();
    }
    
    function getRandom() {
        return elements[Math.floor(Math.random() * elements.length)];
    }
    
    async function run() {
        while (true) {
            let left = getRandom();
            let right = getRandom();
            if (pairs[`${left} + ${right}`]) {
                continue;
            }
            let result = await getResponse(left.split(' ').slice(1).join(' '), right.split(' ').slice(1).join(' '));
            if (result.isNew) {
                console.log('‼ new one ‼');
            }
            result = `${result.emoji} ${result.result}`;
            console.log(`${left} + ${right} = ${result}`);
            if (result != ' Nothing') {
                pairs[`${left} + ${right}`] = result;
                elements.push(result);          
            }
            await sleep(1000);      
        }
    }
    
    run();

Re: Infinite Craft

#498
post #492

The game state clears on reload, so here's a wee console snippet to export your list of elements: console.log(JSON.stringify({discoveries: window.$nuxt.$root.$children[2].$children[0].$children[0]._data.discoveries, elements:window.$nuxt.$root.$children[2].$children[0].$children[0]._data.elements})) I'll figure out how to re-import the state later, but it's past midnight for me now.

The state can be re-imported like this: ``` a = (insert JSON output here) window.$nuxt.$root.$children[2].$children[0].$children[0]._data.elements = a.elements; window.$nuxt.$root.$children[2].$children[0].$children[0]._data.discoveries = a.discoveries; ```

[deleted]

Re: Infinite Craft

#499

Some of my First Discoveries: * Frankenstein + angel = Angelstein. (Then Angelstein + Baby = Angelina Jolie.) * something + Something from Michael Jackson = Dangerous. * Dangerous + Sherlock Holmes = Moriarty. * Multiverse + White => Dark Multiverse + Law => Dark Law. * Dark Law + us Constitution => Dark Constitution. * Quark + Ocean -> Neutreno * Thor + Guardian -> Heimdall * Batman + vet => Batvet * Avengers + Mult…

Super not confusing:

Lincoln + Wife = Lincoln's wife

Should have seen that one coming.

Re: Infinite Craft

#500
post #425

Earlier quoted context omitted.

One man’s nonsense is another’s profound truth. mud + brick = Adobe, for example. Doesn’t seem to make sense, yet it does.

adobe is literally mudbrick, this is too easy – like fire and water = steam

Yeah, I probably should have googled that. In my defense, the emoji it chose was , so a tad misleading to the mudbrick-ignorant.
Post reply on HN