Skip to content

Instantly share code, notes, and snippets.

/* *******************************************************************
grid
******************************************************************** */
.main-container {
display: grid;
grid-template-columns: repeat(auto-fit, 120px);
justify-content: center;
--gap: 10px;
gap: 0px var(--gap);
const ranks = "S+, S+/A-, S, S-, A+, A, A-, B+, B, B-, C+, C, C-, D+, D, D-, E+, E, E-, F+, F, F-".split(", ").reverse();
return app.pokeTypes.map( type => [
type,
Object.values(app.moveData)
.filter( move => move.type === type && move.power )
.map( move => [move.name, move.tierlistRank] )
.sort( ([,leftRank], [,rightRank]) => ranks.indexOf(rightRank) - ranks.indexOf(leftRank) )
]).map(
([type, [[firstName, firstRank], ...otherMoves]]) => [type, firstRank, [firstName, firstRank], ...otherMoves]
[...(function* () {
for (const pokemon of app.pokeData) {
let bestChance = 0;
for (const dish in pokemon.recipeWeights) {
for (const quality in pokemon.recipeWeights[dish]) {
const weight = pokemon.recipeWeights[dish][quality];
const chance = weight / app.recipeWeightSums[dish][quality];
if (!app.recipeTable[dish][quality].length) {
/*
stone slots 0b 0-% 1b 1-% 2b 2-% 3b 3-% perm
0 1 100% 0 0% 0 0% 0 0% 1
1 9 100% 0 0% 0 0% 0 0% 9
2 36 100% 0 0% 0 0% 0 0% 36
3 78 93% 6 7% 0 0% 0 0% 84
4 90 71% 36 29% 0 0% 0 0% 126
5 45 36% 72 57% 9 7% 0 0% 126
6 6 7% 36 43% 42 50% 0 0% 84
7 0 0% 0 0% 18 50% 18 50% 36
const f = ({bingos, reactionTime = 0.1, share, stay, whack, waitless}) => {
const baseCastTime = 1.5; // estimate
const baseCooldown = 8;
const baseBuffDuration = 20;
const castTime = baseCastTime * (1 + whack);
const cooldown = baseCooldown * (1 + bingos + 0.5 * whack - 0.05 * waitless);
const buffStrength = share / 10 * (1 + whack);
const buffDuration = baseBuffDuration * (1 + 0.25 * stay);
@Hidden50
Hidden50 / pq - 9500hp.js
Last active January 25, 2024 05:17
Calculate the chance for a pokemon to fit 9 hp slots, for the 9500 HP challenge in Pokemon Quest
/*
Calculate the chance for a pokemon to fit 9 hp slots, for the 9500 HP challenge in Pokemon Quest
use on the browser console at https://hidden50.github.io/pq/
*/
(function () {
const impossibleDishes = ["Grass_basic", "Poison_basic", "Bug_basic", "Flying_basic", "Electric_basic", "Ambrosia_basic", "Fighting_basic", "Water_special", "Psychic_special", "Fighting_special"];
const dataCopy = JSON.parse(JSON.stringify(app.pokeData));
@Hidden50
Hidden50 / pq - recipeGenerator.js
Last active January 25, 2024 05:18
Pokemon Quest Recipe Generator
/*
* Recipe Generator
*/
(function() {
const recipeData = {
ingredients: {
r: {name: "Tiny Mushroom", quality: 0, properties: ["red", "soft", "mushroom"]},
b: {name: "Bluk Berry", quality: 0, properties: ["blue", "soft", "sweet"]},
@Hidden50
Hidden50 / mainpage.js
Last active May 31, 2018 00:04
basic Service Worker example
// ...
window.addEventListener('load', () => {
if('serviceWorker' in navigator) {
navigator.serviceWorker.register( './sw.min.js', { scope: "./" } )
.then( registration => {
const newWorker = registration.installing;
if (newWorker) {
newWorker.onstatechange = function() {
if (newWorker.state == 'activated' && !navigator.serviceWorker.controller) {