Something went wrong. Try again.
Web version of a solitaire game "Lobo" by James Ernest
Something went wrong. Try again.
1234567891011121314151617181920212223export class Stack<T> { #list: T[]
constructor(list: Iterable<T>) { this.#list = Array.from(list) }
get size() { return this.#list.length }
get top() { return this.#list[0] ?? null }
pop() { if (this.#list.length === 0) { return null } return this.#list.shift() ?? null }}