This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| Algorithms module: Hardcoded CFOP algs as move sequences. | |
| Complex: Grouped by case, with recognizers. | |
| """ | |
| from typing import Dict, List, Tuple | |
| from constants import PHASES | |
| # OLL cases (example: 2 from 57) | |
| OLL_ALGS: Dict[str, List[str]] = { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <template> | |
| <div id="app"> | |
| <router-view /> | |
| </div> | |
| </template> | |
| <script setup> | |
| // Global composables or stores can go here | |
| import { useUniverseStore } from '@/store/universeModule.js' | |
| const store = useUniverseStore() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| AISnake: Dumb-but-fun AI player using greedy lookahead. | |
| Extends Snake with decision-making. | |
| """ | |
| from typing import Optional | |
| import heapq # For A* lite | |
| from snake import Snake | |
| from vector import Vector2D | |
| from constants import AI_DIFFICULTY |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Inventory class: Manages a collection of Items (add, remove, search, list). | |
| require_relative 'item' | |
| class Inventory | |
| def initialize | |
| @items = [] | |
| end | |
| def add_item(name, price, quantity = 0) | |
| item = Item.new(name, price, quantity) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| Game module: Handles the 'Quote Quest' quiz logic. | |
| Uses a provided quote/author to run a simple guess-the-author game. | |
| """ | |
| def play_quiz(quote, author): | |
| """ | |
| Runs the quiz: Shows quote, lets user guess author from options. | |
| Returns True if won, False if lost. | |
| """ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>Motivational Advice from Legends</title> | |
| <style> | |
| body { | |
| font-family: 'Georgia', serif; | |
| background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Tic-Tac-Toe Game in TypeScript | |
| * X (Player 1) vs O (Player 2) on a 3x3 grid. | |
| * Console-based: Enter row/col (0-2) for moves. | |
| * Detects wins, draws, and invalid inputs. | |
| */ | |
| type Player = 'X' | 'O'; | |
| type Cell = Player | null; | |
| type Board = Cell[][]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import itertools | |
| import time # For a subtle delay to simulate "immersion" | |
| def klein_bottle_loop(): | |
| """ | |
| An infinite generator loop inspired by the Klein bottle: | |
| Yield messages in an endless cycle, but consume with a stop condition. | |
| Twist out when you're ready—no harsh breaks! | |
| """ | |
| messages = [ |