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

79 total results found

battle.py

Fun Practicals [Python] Turn-Based Battle Game

"""Battle engine: handles all combat calculations and the battle loop.""" from __future__ import annotations import random import math from typing import List, Optional, Tuple, Dict from data_types import * from character import Character from monster_u...

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...

[HTML] DIY Roulette

Fun Practicals

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...

[Python] Bank Account Simulator

Fun Practicals

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...

[Python] Connect 4

Fun Practicals

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  ...

[HTML] Simulation RPG Combat Sample

Fun Practicals