Skip to content

Instantly share code, notes, and snippets.

View esco's full-sized avatar

Esco Obong esco

View GitHub Profile
@esco
esco / ARCHITECTURAL_PRINCIPLES.md
Created June 9, 2025 17:53
Architectural guidance provided to Claude Code CLI for building yugioh game engine with prompts

System Prompt: Architectural Principles to Code By

Use rg tool to search for files efficiently

Core Principles

  1. Clean, Simple, Maintainable Code
    • Favor readability over cleverness
    • Prioritize simplicity in design
  • Write code that future developers can easily understand
@esco
esco / CARD_EFFECT_SYSTEM.md
Created June 9, 2025 17:44
Guidance provided to Claude Code CLI for building yugioh game engine with prompts

Card Effect System Documentation

1. Introduction

This document describes the architecture and workflow of the card effect system within the Yu-Gi-Oh! Web Duel Interface. The system is responsible for handling the activation, chaining, and resolution of card effects according to Yu-Gi-Oh! rules. It integrates declarative effect definitions (partially implemented via YAML/JSON) with the core game engine logic.

The system aims to manage:

  • Activation: Determining when and if a card effect can be activated.
  • Chaining: Building a sequence of effects when multiple effects are activated in response to each other.
  • Resolution: Executing the effects in the correct (Last-In, First-Out) order.
// https://leetcode.com/problems/valid-parentheses/solution/
/**
* @param {string} s
* @return {boolean}
*/
function isValid(s) {
const stack = []
const open = {
"(": true,
@esco
esco / sequence-pool.js
Created November 4, 2020 17:42
SequencePool
function SequencePool(start=0, _next=(num)=>num+1) {
let pool = [start]
function next() {
let item = pool.pop()
if (!pool.length) {
pool.push(_next(item))
}
return item
}
@esco
esco / store.js
Last active November 3, 2020 14:53
Simple Redux Store
function createStore(reducer, preloadedState) {
let state = preloadedState
const idPool = [0]
const listeners = new Map()
function getState() {
return state
}
function subscribe(listener) {
@esco
esco / leetcode-844-backspace-string-compare.js
Last active September 9, 2022 10:59
Leetcode 844. Backspace String Compare
function backspaceCompare(S, T) {
const s = evaluate(S)
const t = evaluate(T)
return s === t
};
function evaluate(str) {
const output = []
for (const char of str) {
if (char !== '#') {

Keybase proof

I hereby claim:

  • I am esco on github.
  • I am esco (https://keybase.io/esco) on keybase.
  • I have a public key ASBUFgepSRzEr-xiHms-JaDghmonHJbBE8ZwvrsQZ4bUlgo

To claim this, I am signing this object:

@esco
esco / rinkeby faucet
Created July 13, 2017 13:27
Rinkeby Faucet
0xe757E4deFDC56De8ab339fD912b16711C1B5380D
@esco
esco / gist:523f2c89aec552578899
Created August 18, 2014 17:47
p2p card game
player1 deck - d1
player2 deck - d2
d1_e == e(ki, d1)
d2_e == e(ki, d2)
p1 <-- d1, d2_e
p2 <-- d2, d1_e
seed - s