Giter Site home page Giter Site logo

hex's Introduction

general overview / notes

Hopefully hex will be a hexagonal grid based spacial programming system. So far, here are the general ideas i have for it:

  • Hexagonal grid (obviously)

  • Each hexagon can have hexcode inside of it

  • 1 byte can indicate all directions combinations on a hexagon as well as up and down

  • There can be multiple layers of hex grid

  • Extra bytes in a hex could be used to execute commands

  • Three modes: Edit, Remove, Run

    • in edit mode, the user can click on a hex to edit it's hexcode and other attributes
    • in remove mode, clicking on a hex will clear it
    • in run mode a user can click on a hex to add it to the hex queue
  • when a hex runs, it will add hexes to the queue using the direction hex

  • the hex queue will be added to in a clock-wise motion starting from the top

  • once the current tick's hex queue is empty, the next tick will start with the new queue

  • if the next tick's queue is empty, the program will end

  • individual hexes may have a background color and border color for inactive and active states

  • individual hexes may have some kind of internal storage

  • hexes may be able to acces some kind of global storage

  • hexes may be able to access the storage of their neighbors

opcodes

  • Ideally there should be very few op codes, maybe 16 as to fit onto one hexcode
  • A neighbor code (NC) is a 1 byte value that refers to any combination of hex neighbors
  • a hex stops running when a next is successfully called
  • A location (L) is a 4 bit value that refers to a location (self, neighbors, global stacks A-G)
  • ACC is the local hex's accumulator
  • All processes that read from L read from the top of the stack. this pops the value.
  • Io location consists of two L, for a total of 64kb of memory locations
  • [Feature?] the neighbor codes of those who called the current hex should be stored in one of the global stacks
  • all nexts should be able to accept a location for a neighbor code, which will grab the value off of the top of the stack
    • next NC
    • next if zero NC
    • next if greater than zero NC
    • next if less than zero NC
    • add L to ACC
    • sub L to ACC
    • push L from ACC
    • pop L into ACC
    • set val in ACC
    • nxz L NC
    • nxgz L NC
    • nxlz L NC
    • negate the ACC
    • read io location into ACC
    • write io location into ACC
    • nop? I don't think i really need a nop, but there's one here if i need it.

TODO

  • build a parser for the instruction set
  • build a runner for the grid
  • add a run options panel

Open questions

  • How do other assembly / machine languages handle by value and by reference?
  • are there any order to opcodes? are their bin values random?

hex's People

Contributors

yukiiro-nite avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.