Skip to content

Instantly share code, notes, and snippets.

@codedmonkey
codedmonkey / pokemon-gl-attraction.js
Created April 21, 2020 21:16
Pokemon Global Link Generation 6: Balloon Popping minigame analysis
// This is an analyis of the Pokemon Global Link Balloon Popping attraction, original source code:
// http://3ds.pokemon-gl.com/pc/pokemonfesta/13816710-1dd2-11b2-0000-242d50cf1ff7/js/attraction.js
// Related variables:
Config.rank=[15,27,45,10,3]; // The percentage for each rank: Rank E - Rank A
Config.rankScore=[30,50,70,80,100]; // The maximum score for each rank: Rank E - Rank A
// This function is initialised when the application reaches the result screen
@codedmonkey
codedmonkey / FooRequest.php
Last active June 27, 2018 21:20
[Symfony Form] Unique Entity Validation for Custom Data Objects (Use at own risk! Non-persisted changes to an entity will be reset after the validation process. A real solution would be to rewrite Symfony's UniqueEntityValidator completely.)
<?php
// src/Form/Request/FooRequest.php
namespace App\Form\Request;
use App\Validator\Constraints as AssertApp;
/**
* @AssertApp\UniqueEntity("bar", entityClass="App\Entity\Foo")
*/
@codedmonkey
codedmonkey / autoload.php
Last active August 29, 2015 14:00
Simple PSR-4 autoloader
<?php
/**
* Very simple PSR-4 compatible autoloader
*/
function __autoload($className)
{
/**
* Specify Directories
*