Skip to content

eruvanos/hrm_python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Human Resource Machine Python Editor

Quelle http://store.steampowered.com/app/375820/?l=german

Introduction

This project started as an interpreter for the human resource machine format, but after some done stuff I started to create a gui and the target changed.

So the goal is now to create an editor/ ide for the human resource machine format. Supporting editing, executing and debugging the hrm-format.

Available operators

Operator Effect
INBOX Pop next value from INBOX to POINTER
OUTBOX Put value from POINTER to OUTBOX
COPYFROM <REF> Copy value to POINTER
COPYTO <REF> Copy value to referenced register
ADD <REF> Adds value from REF to POINTER
SUB <REF> Subtracts value from REF to POINTER
BUMPUP <REF> Increment value of REF and copy it into POINTER
BUMPDN <REF> Decrement value of REF and copy it into POINTER
JUMP <LABEL> Jump to LABEL
JUMPZ <LABEL> Jump to LABEL if POINTER is zero
JUMPN <LABEL> Jump to LABEL if POINTER is negative
COMMENT 0 Will be ignored

REF

REF declares which register to use for operator, there are two types available:

  • Direct access: 1
  • Indirect access: [1] -- Accesses the register, defined by the value of declared register

Example:

INBOX //1
COPYTO 1
BUMPUP [1]
COPYFROM 1
OUTBOX //2

JUMP/LABEL

With a JUMP operator the PC (program counter - defines which position in code should be interpreted) will set to the given LABEL

Example:

INBOX //1
COPYTO 1
JUMP a
BUMPUP 1 //Skipped
a:
OUTBOX //1

POINTER

The machine is able to keep one value on the "BUS" (keep it active). This value is used in operations like outbox or inbox.

Roadmap

Backend

[x] Return new state from tick
[x] Create level module holding state, messages and check 1-4
[x] Support character as values (only subtraction with two chars allowed)
[ ] Create level module holding state, messages and check 4-...

GUI

[x] Undo Button to go back to previos state
[x] Reset button setup first state
[x] En- and disable buttons
[x] Editable code window
[x] Highlight code and mark errors
[x] Load menu for Level
[x] Load code from file
[x] Save code to file
[x] Add scrollbar to code editor
[x] Center window [-] Show when program finishes
[x] Show errors when they occur
[x] Copy solution to clipboard
[x] Paste solution from clipboard
[x] Hotkeys: Move Up (Ctrl/CMD-Up)
[x] Hotkeys: Move Down (Ctrl/CMD-Down)
[x] Hotkeys: Delete Line (Ctrl/CMD-BackSpace)
[x] Use icons
[x] Add disabled state buttons [x] Show level check result
[x] Hotkeys: Duplicate Line (Ctrl/CMD-D)
[ ] Use better icons
[ ] Add help for syntax in some way
[ ] Automatic timer for tick (Slider 1s-5s) (With "Play" and "Pause" button?)
[ ] Add statistics about execution
[ ] Editable inbox window
[ ] Editable regs window
[-] Redesign gui (remove borders, add colors, backgrounds, ...)
[ ] Experiment: Use pymitter events to manage gui state and updates

Icon Sources: Icon8

About

Human Resource Machine - Python Editor

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages