Skip to main content
Advanced Search
Search Terms
Content Type

Exact Matches
Tag Searches
Date Options
Updated after
Updated before
Created after
Created before

Search Results

54 total results found

character.py

Fun Practicals [Python] Turn-Based Battle Game

"""Character class - handles stats, leveling, skills, status effects.""" from __future__ import annotations import random from dataclasses import dataclass, field from typing import List, Dict, Optional, Tuple from data_types import * from skills_db impo...

companions.py

Fun Practicals [Python] Turn-Based Battle Game

"""Companion character database: 20x3★, 10x4★, 5x5★.""" from __future__ import annotations import random from data_types import * from character import Character, JOB_BASE_STATS, JOB_GROWTH from skills_db import SKILL_DB, JOB_SKILL_POOL def _make_com...

data_types.py

Fun Practicals [Python] Turn-Based Battle Game

"""Core data types, enums, and constants for the JRPG game.""" from __future__ import annotations from dataclasses import dataclass, field from enum import Enum, auto from typing import Optional, List, Dict, Any class WeaponType(Enum): SWORD = "S...

game_state.py

Fun Practicals [Python] Turn-Based Battle Game

"""Game state: manages party, inventory, battle progression.""" from __future__ import annotations import random from dataclasses import dataclass, field from typing import List, Dict, Optional, Tuple from data_types import * from character import Charac...

items_db.py

Fun Practicals [Python] Turn-Based Battle Game

"""Items database with 120 items.""" from data_types import * def build_item_database() -> Dict[int, Item]: items = {} def add(id, name, itype, desc, val, target=SkillTarget.SINGLE_ALLY, elem=None, cures=None, buff=None, bdur=0): ...

monster_unit.py & monsters_db.py

Fun Practicals [Python] Turn-Based Battle Game

monster_unit.py """Monster combat unit - wraps MonsterTemplate with battle state.""" from __future__ import annotations import random from dataclasses import dataclass, field from typing import List, Optional from data_types import * from monsters_db im...

skills_db.py

Fun Practicals [Python] Turn-Based Battle Game

"""Skills database with 100 skills across all job classes.""" from data_types import * def build_skill_database() -> Dict[int, Skill]: skills = {} def s(id, name, stype, power, mp, acc, elem, hits, target, tier, desc, jobs, effect=None): skills...

Fair Roulette

Fun Practicals [HTML] DIY Roulette

<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>Fortune Wheel</title> <link href="https://fonts.googleapis.com/css2?family=Playfair+Display:wght@700;900&fami...

Biased Roulette

Fun Practicals [HTML] DIY Roulette

<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>Fortune Wheel</title> <link href="https://fonts.googleapis.com/css2?family=Playfair+Display:wght@700;900&fami...

main.py

Fun Practicals [Python] Bank Account Simulator

import json import datetime # load account if exists def load_account(): try: with open("account.json", "r") as f: account = json.load(f) return account except FileNotFoundError: return -1 # create ...

account.json

Fun Practicals [Python] Bank Account Simulator

{"balance": 1038.0, "transactions": [{"transaction_id": "0000000001", "type": "deposit", "amount": 50.0, "date": "2025-12-07 22:51:28.043060", "balance_after": 50.0}, {"transaction_id": "0000000002", "type": "deposit", "amount": 50.0, "date": "2025-12-07 22:51...

main.py

Fun Practicals [Python] Connect 4

board=[[' ']*7, [' ']*7, [' ']*7, [' ']*7, [' ']*7, [' ']*7] fin=False valid=True r=0 def display(): global board row=' ' for i in range(6): row='ㅣ'+board[i][0] for j in range(6): ...

[Python] Important Algorithms

[Concepts] Paper 4

Factorial function def factorial(n): #Task 1: Factorial function if n==0: #Case 1: 0! return 1 else: #Case 2: <positive_integer>! return n*factorial(n-1) #multiply with factorial of n-1 Recursive arithmetic sum  ...

Battle Sample

Fun Practicals [HTML] Simulation RPG Combat Sample

<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <style> *{box-sizing:border-box;margin:0;padding:0} body{font-family:sans-serif;background:#1a1a2e;color:#eee;user-select:none;min-height:100vh} #app{display:flex;flex-direction:column;align...

Version 1

Fun Practicals [Python] Chess

Requires:- Pygame- Stockfish 18 Which can be downloaded by running: pip install pygame brew install stockfish Code: """ Chess Game — Lichess-style UI (v3 — all fixes applied) Fixes: 1. Move list: white & black on SAME ROW (1. e4 e5) 2. Piece ...

Version 2

Fun Practicals [Python] Chess

Requires: pip install pygame brew install stockfish Code: """ Chess Game — Lichess-style UI (v3 — all fixes applied) Fixes: 1. Move list: white & black on SAME ROW (1. e4 e5) 2. Piece rendering: platform-aware font fallback, letter-in-box if no ...

Download PDFs here!

Downloadable summary PDFs

Pure 1.pdf Stat 1.pdf Mech 1.pdf

New Page

Fun Practicals