Skip to content

Infinite-Networker/KursarScript

Repository files navigation

KursarScript Banner


License: MIT Python Tests Status Made by


⬡ KursarScript

KSPL — Virtual Reality Programming Language

A groundbreaking programming language designed for virtual reality environments and digital economies.
Create, manage, and scale virtual marketplaces, avatar interactions, and immersive transactions
with an intuitive syntax built for the metaverse.


⚡ Get Started · { } Syntax Guide · 🌐 VR API · 🗺️ Roadmap · ★ GitHub



🌐 Overview

KursarScript (KSPL) is a specialized programming language that enables developers to create and manage virtual economies within VR environments. It provides built-in support for digital currencies, virtual assets, and immersive transactions through its innovative Virtu-Card system and Virtual-Terminals.

Designed from the ground up by Cherry Computer Ltd., KursarScript gives VR developers first-class language primitives that no mainstream language provides — meaning less boilerplate, more immersion.



✨ Key Features

🎮 Virtual Reality Integration

  • Avatar Management — Create and control avatars in VR environments
  • Virtual Terminals — Service hubs for buying/selling virtual goods
  • Virtual Portals — Connect terminals across different VR spaces
  • Immersive Transactions — Real-time virtual economy operations

🏗️ Object-Oriented Design

  • Classes & Objects — Define virtual entities and their behaviours
  • Methods & Fields — Encapsulate functionality and state
  • No Inheritance — Simplified flat object model for VR environments
  • Inline Method Bodies — Single-line and multi-line method syntax

💳 Virtual Economy System

  • Virtu-Card — Secure storage and transfer of digital denominations
  • Digital Currencies — Support for virtual coins and banknotes
  • Transaction Security — Built-in security levels and history tracking
  • Marketplace Operations — List, buy, and sell virtual items

🤖 AI-Inspired Concepts

  • Smart Operations — Automated currency exchange and transactions
  • Adaptive Behaviour — Objects that respond to environment changes
  • Virtual Intelligence — Basic AI for NPCs and automated systems


🚀 Installation

From PyPI (once published)

pip install kursarscript

From Source (Development)

# Clone the repository
git clone https://github.com/Infinite-Networker/KursarScript.git
cd KursarScript

# Install in development mode
pip install -e .

# Verify installation
kursarscript --version


⚡ Quick Start

Running a Script

kursarscript examples/hello_world.kursar
kursarscript examples/economy.kursar
kursarscript examples/test.kursar

Interactive REPL

kursarscript -i
# or
kursarscript --interactive

Python Module

python -m kursarscript script.kursar


📖 Language Syntax

Variables

let name    = "Alice"
let balance = 1000.0
let active  = true
let nothing = null

Functions

fn greet(person) {
    print("Hello,", person)
}

fn add(a, b) {
    return a + b
}

greet("World")
let result = add(3, 7)

Classes

class Player {
    field health = 100
    field name   = ""

    fn init(player_name) {
        self.name = player_name
    }

    // Inline method bodies
    fn heal(amount)   { self.health = self.health + amount }
    fn is_alive()     { return self.health > 0 }

    fn describe() {
        print("Player:", self.name, "HP:", self.health)
    }
}

let player = Player("Hero")
player.heal(50)
player.describe()

Control Flow

if (balance > 500) {
    print("Rich!")
} else if (balance > 100) {
    print("Okay")
} else {
    print("Need credits")
}

Loops

// For loop over a list
let items = ["Sword", "Shield", "Potion"]
for item in items {
    print("-", item)
}

// For with range
for i in range(1, 6) {
    print(i)
}

// While loop
let count = 0
while (count < 5) {
    count = count + 1
}

// Break and Continue
for x in [1, 2, 3, 4, 5] {
    if (x == 3) { continue }   // skip x = 3
    if (x == 5) { break }      // stop at x = 5
    print(x)
}

Multi-line Expressions

// Multi-line list
let market_data = [
    {"item": "Sword",  "price": 150.0},
    {"item": "Shield", "price": 200.0}
]

// Multi-line arithmetic
let total = 100.0 +
            200.0 +
            300.0


🌐 Virtual Economy

// ── Create avatars with VirtuCards ──────────────────────────────────────────
let alice = Avatar("Alice_VR", "explorer")
alice.virtucard = create_virtucard(alice, 1000.0)
alice.virtucard.set_security("high")

// ── Build a virtual marketplace ─────────────────────────────────────────────
let shop = VirtualTerminal("NexusMarket", "general")
shop.list_item("Health Potion", 25.0, "Restores 50 HP")

// ── Purchase (2-arg shorthand) ───────────────────────────────────────────────
shop.purchase("Health Potion", alice.virtucard)

// ── Purchase (3-arg form) ────────────────────────────────────────────────────
shop.purchase_item(alice, "Health Potion", alice.virtucard)

// ── Transfer funds between avatars ──────────────────────────────────────────
let bob = Avatar("Bob_VR", "merchant")
bob.virtucard = create_virtucard(bob, 500.0)
transfer(alice.virtucard, bob.virtucard, 100.0)

// ── View transaction history ─────────────────────────────────────────────────
let history = alice.virtucard.get_history()
for txn in history {
    print(txn)
}

Virtual Items with Rarity

let sword = VirtualItem("Dragon Sword", "weapon", 1000.0)
sword.set_rarity("legendary")       // 10× value multiplier
sword.set_attribute("damage", 500)

print(sword.calculate_value())      // → 10000.0


🌐 Built-in Types Reference

Avatar

Method / Field Description
Avatar(name, role) Create a new avatar
avatar.name Avatar's display name
avatar.role Avatar's role (explorer, merchant, …)
avatar.virtucard Attached VirtuCard (set explicitly)
avatar.set_attribute(key, value) Set a custom attribute
avatar.get_attribute(key) Get a custom attribute
avatar.get_inventory() List of owned items

VirtuCard

Method / Field Description
create_virtucard(avatar, amount) Factory — create a card
card.balance Current balance
card.security_level Security level string
card.tap_denominator(amount) Add bonus credits
card.debit(amount) Deduct credits
card.credit(amount) Add credits
card.set_security(level) low / medium / high / maximum
card.get_history() Get transaction history list
transfer(from_card, to_card, amount) Transfer between cards

VirtualTerminal

Method / Field Description
VirtualTerminal(name, category) Create a marketplace
terminal.list_item(name, price, desc) List item by name + price
terminal.list_item(virtual_item) List a VirtualItem object
terminal.get_inventory() Get all listings
terminal.purchase_item(buyer, name, card) 3-arg purchase
terminal.purchase(name, card) 2-arg shorthand

VirtualItem

Method / Field Description
VirtualItem(name, type, base_value) Create an item
item.set_rarity(level) common · uncommon · rare · epic · legendary
item.calculate_value() base_value × rarity multiplier
item.set_attribute(key, value) Custom attribute
item.get_attribute(key) Retrieve attribute


📂 Example Scripts

File Description
examples/hello_world.kursar Language basics: variables, loops, functions, if/else
examples/classes.kursar Object-oriented programming with classes
examples/economy.kursar Virtual economy with VirtuCards and markets
examples/advanced.kursar while loops, break, continue, inline method bodies
examples/test.kursar Full comprehensive VR economy demonstration


🗂️ Project Structure

KursarScript/
├── kursarscript/              # Main Python package
│   ├── __init__.py            # Package entry point & exports
│   ├── __main__.py            # python -m kursarscript support
│   ├── interpreter.py         # KSPL interpreter (parser + executor)
│   ├── compiler.py            # KSPL compiler (tokenizer + code gen)
│   ├── runtime.py             # Built-in VR types (Avatar, VirtuCard, etc.)
│   └── cli.py                 # Command-line interface & REPL
├── examples/
│   ├── hello_world.kursar     # Beginner example
│   ├── classes.kursar         # OOP example
│   ├── economy.kursar         # Economy system example
│   ├── advanced.kursar        # while, break, continue, inline methods
│   └── test.kursar            # Comprehensive demo script
├── tests/
│   └── test_kursarscript.py   # 117 automated tests
├── src/                       # Original source files (reference)
├── docs/
│   └── ROADMAP.md             # Development roadmap
├── index.html                 # Showcase website
├── pyproject.toml             # Package configuration
├── setup.py                   # Legacy setup support
└── README.md                  # This file


🧪 Running Tests

pip install pytest
pytest tests/ -v

# Quick summary
pytest tests/ -q
# Expected: 117 passed


🗺️ Roadmap

Status Milestone
Shipped Core language interpreter — variables, functions, classes, loops, control flow
Shipped VR economy primitives — Avatar, VirtuCard, VirtualTerminal, VirtualItem
Shipped CLI & Interactive REPL
Shipped 117 automated tests
In Progress PyPI publication
🔜 Planned Extended standard library (networking, physics hooks, NPC modules)
🔜 Planned VS Code extension — syntax highlighting, IntelliSense, debugger

See docs/ROADMAP.md for the full development roadmap.



📄 License

MIT License — © 2024–2025 Cherry Computer Ltd.

See LICENSE for the full license text. KursarScript is free for personal, commercial, and research use.



🍒 Cherry Computer Ltd.

"Innovating Tomorrow's Virtual World"

KursarScript is a product of Cherry Computer Ltd. — a forward-thinking technology
company dedicated to building the tools and languages that power the next generation
of virtual reality and digital economy platforms.


GitHub Repo


Built with ❤️ by Cherry Computer Ltd.

About

KursarScript is a groundbreaking programming language designed specifically for virtual reality environments and digital economies. Create, manage, and scale virtual marketplaces, avatar interactions, and digital transactions with an intuitive syntax built for VR development.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors