• solar_power

    # Solar System Simulation with Three.js

    – Sun, planets, moons, asteroids, and comets with dynamic orbit and rotation behaviors, adjustable settings.

    ## Description

    Simulates the **Solar System** in 3D, includes textures for planets, moons, and the sun. Interactive components include adjustable time-lapse speeds, orbit visibility, and labels for celestial bodies.

    The simulation provides real-time interactions via mouse hover for information popups and offers responsive resizing to fit various screen dimensions. —

    ## Interact:

    Adjust the Time Lapse Speed to increase or decrease orbital speeds.

    Hover over planets and moons to view details in the popup window.

    Use the GUI to:

    Toggle Orbits visibility.

    Toggle Labels visibility.

    HTML JSolarSystem.html

  • glitch

    A simulation project showcasing a universe formation model with expanding and merging particle shapes.

    Unfinished, just like in real life…


    HTML glitch.html

    BOOK theglitch.amazon

  • Battleships

    A **simple** text-based Battleship game implemented in a batch script.

    Players try to sink a computer’s ship while avoiding its shots.

    The game uses a grid-based system to place ships and guess their locations.

    ## Description

    The game creates a 5×5 grid for both the player and the computer. The player can place their ship on their board, and the computer randomly places its ship. Players take turns trying to guess the coordinates of the computer’s ship. The game provides feedback on hits and misses and ends when one player successfully sinks the other’s ship.

    ## Requirements

    – Windows OS with Command Prompt support.
    – Basic understanding of coordinates and grids.

    ## Usage
    1. **Download the script** and save it as `battleships.bat`.
    2. **Run the script** by double-clicking it

    BAT battleships.txt

  • find_the_beep

    Description

    The objective of Find The Beep is to create a dynamic grid where letters “B”, “E”, and “P” are placed randomly, while avoiding the word “BEEP”.

    Inspiration

    This was inspired by the book

    Find the Fox: An Almost Impossible Word Search by Alex Cheddar.

    The book presents a unique 240-page word search using only the letters F, O, and X, where the only word present is “FOX”. The challenge and creativity in reducing the puzzle to three letters and one word inspired me to create a similar minimalist puzzle concept with “BEEP.”


    Usage

    1. Open the webpage.
    2. Enter the desired number of rows and columns (minimum 4×4).
    3. Click “go” to generate the grid.
    4. Observe the grid ensuring no BEEPs are formed.

    Project Origins

    My original version of Find The Beep was created using Python. I developed an Excel-based solver with VBA to scan and ensure that the sequence “BEEP” never appeared in the generated grids. The transition to JavaScript allowed me to bring this to the web, where users can interactively create grids and visualize the results.

    PYTHON find_the_python.txt

    VBA find_the_vba.txt


    Code Method

    • Grid Generation: Dynamically creates grids based on user input.
    • Conflict Avoidance: Utilizes directional checks to prevent specific sequences.
    • Retry Mechanism: Automatically retries generation if conflicts arise.

    HTML FindTheBeep.html

    Bonus:

    HTML FindTheTax.html

  • API_piano

    Description

    This is a simple web-based piano player built using the Web Audio API. It allows users to input a sequence of musical notes, specify their octaves and durations, and play them back using various waveforms like sine, square, triangle, or sawtooth. It also features adjustable volume controls.

    Features

    • Note Input: Enter musical notes in a specified format.
    • Octaves & Durations: Define the octave and duration for each note.
    • Simultaneous Notes: Play multiple notes at the same time.
    • Waveform Selection: Choose between different sound waveforms (Sine, Square, Triangle, Sawtooth).
    • Volume Control: Adjust the output volume.

    Usage

    Enter a sequence of notes in the text area in the following format:

    • Notes: C, C#, D, D#, E, F, F#, G, G#, A, A#, B
    • Octave: Add a number after the note for octave (e.g., C4)
    • Duration: Add a duration in seconds (e.g., C#4(0.5))
    • Simultaneous Notes: Write notes together before the duration (e.g., C3E3A3(0.5))
    • Separate Notes: Use commas to separate different notes (e.g., C4(1),D4(0.5),E4)

      HTML WebAudioAPI_piano.html

    1. circuit_fibonacci

      Description

      This CircuitPython script is designed to display a visual Fibonacci sequence-based clock on an Adafruit-compatible display. Using the board, displayio, and RTC libraries, it draws colored rectangles on the screen, which represent Fibonacci numbers. The clock updates its display every minute, with the color of the rectangles changing based on the current time (hours and minutes).

      Display Logic

      • Fibonacci squares of sizes: 1, 1, 2, 3, and 5 are drawn.
      • The squares are positioned to fit on the screen with a 1-pixel border.
      • The clock represents hours and minutes through color-coded squares:
        • Red: Hours (decomposed into Fibonacci numbers).
        • Green: Minutes (in multiples of 5).
        • Blue: If both hours and minutes are represented by the same Fibonacci number.

      Example Output

      Rectangles will be filled based on the current time:

      • 1×1, 1×1, 2×2, 3×3, and 5×5 Fibonacci squares on the screen.
      • These squares will change color every minute to reflect the current time.

      cPYTHON fibonacci.txt

    2. piano_simulator

      Overview

      This program is a basic piano simulator designed for the Cardputer platform using the MicroHydra framework. It maps keyboard keys to musical notes, which are played through an I2S audio output. The display shows a key layout (white and black keys), and users press keys to generate sine wave-based sounds corresponding to musical notes.

      Features

      • I2S Audio Output: Generates sine wave sounds corresponding to piano notes.
      • Key Mapping: QWERTY keys mapped to white notes and number keys mapped to black (sharp) notes.
      • Display Interface: Displays key layout, showing the mapping of black and white keys.

      Installation

      • Ensure MicroHydra is installed on your Cardputer.
      • Upload the required files, including the userinput, display, and I2S configuration.
      • Run the program to start the piano simulator.

      Controls

      • White Keys (QWERTY): Play notes from C4 to E5.
      • Black Keys (1, 2, 4, 5, 6, 7, 8, 0): Play sharp notes.

      Notes

      • Uses a sine wave generator for audio.
      • Plays notes from C4 to E5, including sharps.
      mHYDRA piano.txt
    3. binary_conversion_app

      Overview

      This is a simple binary conversion application designed for the Cardputer platform using the MicroHydra framework. The app allows users to:

      • Convert decimal numbers to binary.
      • Convert binary numbers to decimal.

      The app uses a menu to guide users through selecting the type of conversion, inputting numbers, and viewing the results. The display interface is managed via the display module, user input is handled by the userinput module, and configuration settings are accessed via the config module.

      Features

      • Menu-based interface for choosing conversion type.
      • Binary-to-decimal and decimal-to-binary conversion.
      • User-friendly input with error handling for incorrect formats.

      Key Modules

      • display: Manages output display on the screen.
      • userinput: Captures user keypresses for input.
      • config: Accesses and applies configuration settings like color palettes.

      Installation

      • Install the MicroHydra framework on the Cardputer.
      • Copy the application files (display, userinput, config, and font modules) to the Cardputer.
      • Run the application to start converting numbers between binary and decimal.
      mHYDRA binary_numb.txt
    4. percentage_calculator_app

      Overview

      This app is built for the Cardputer platform using the MicroHydra framework. It allows users to perform several percentage-related calculations such as:

      • Find X% of Y – What is X% of a given number?
      • What percentage X is of Y – Calculate what percentage X is of Y.
      • Percentage Change from X to Y – Determine the percentage increase or decrease from X to Y.
      • Determine what number X is Y% of – Find the number for which X is Y%.
      • Percentage Difference between X and Y – Calculate the percentage difference between two numbers.

      The display interface is handled using the display module, user input is captured through the userinput module, and the configuration is accessed via the config module.

      Features

      • User-friendly input for performing common percentage calculations.
      • Text wrapping to display results on small screens.
      • Modular design leveraging MicroHydra libraries.

      Modules

      • display: Handles output rendering.
      • userinput: Captures user interactions.
      • config: Manages configuration settings.
      mHYDRA cal_percentage.txt
    5. note-taking_app

      Overview

      This is a basic note-taking application designed for the Cardputer platform using the MicroHydra framework. It allows users to write and save notes to an SD card and view previously saved notes. The app provides an intuitive interface for managing notes, with text display managed via the display module, user input handled through the userinput module, and note storage via the sdcard module.

      Features

      • Write Notes: Users can type and save new notes to an SD card.
      • Read Notes: View previously saved notes with scrolling functionality.
      • SD Card Integration: Notes are stored in a file on the SD card.

      Installation

      • Ensure MicroHydra is installed on your Cardputer.
      • Upload the required modules: display, userinput, sdcard, and the appropriate font.
      • Mount an SD card and run the application.

      Controls

      Escape (ESC): Exit reading mode.

      Write a new note.

      Read saved notes.

      Arrow Keys (UP/DOWN): Scroll through notes.

      Enter (ENT): Save the current note.

      mHYDRA note_app.txt
    6. password

       go  start hacking

      Timer: 0s

    7. boogotchi

      This Tamagotchi app is a virtual pet game designed for the Cardputer platform, where the user interacts with a ghost-like creature named “Boo.” It simulates a virtual pet that the user needs to take care of by feeding, playing games, and keeping it happy. Unlike the original Tamagotchi, Boo is a ghost – thus cannot die

      Key Parts

      Blinking Animation: The ghost (Boo) alternates between two images (“ghost” and “ghost_blink”) to simulate blinking.

      Movement: Boo moves around the screen, bouncing off the edges.

      Menu & Stats: The user can press buttons to open the stats screen or the menu (which has options to feed Boo or play a higher/lower game).

      Frame Buffers: It uses framebuf to handle the raw image data of Boo.

      Loading and Saving Stats: Stats are stored in a file (data.txt) and are loaded or saved when necessary.

      mHYDRA main.txt

      mHYDRA stats.txt

      mHYDRA menu.txt

    8. numTidy

      Python script wrote for use as a function for Caseware’s IDEA.

      This script defines a function numTidy that takes a string representation of a number and cleans it by removing unwanted characters and ensuring the number is properly formatted.

      How It Works:

      The line cleaned_str = re.sub(r'[^\d.-]’, ”, number_str) uses regular expressions to remove any characters from the input string that are not digits (\d), a negative sign (-), or a decimal point (.)

      Next section checks if there is more than one negative sign. If so, it keeps only the first negative sign at the front by using cleaned_str = ‘-‘ + cleaned_str.replace(‘-‘, ”, 1).

      If the string contains multiple decimal points, this part splits the string at the first decimal point and joins the remaining parts, allowing only one decimal point.

      The line cleaned_str = re.sub(r'[^0-9]+\Z’, ”, cleaned_str) removes any non-numeric characters that appear at the end of the string after numbers.

      The function then attempts to convert the cleaned string into a floating-point number using float(cleaned_str). If successful, the number is returned as a string.

      ## Usage:

      This function can be used in various contexts, such as cleaning user inputs that may include non-numeric characters, to ensure valid numerical data. In IDEA, the function would be called using @Python(“numTidy”, [data]).

      PYTHON numTidy.txt