Giter Site home page Giter Site logo

atesgoral / hrm-solutions Goto Github PK

View Code? Open in Web Editor NEW
423.0 27.0 177.0 4.3 MB

Human Resource Machine solutions and size/speed hacks

Home Page: http://atesgoral.github.io/hrm-solutions/

Assembly 94.60% JavaScript 2.83% HTML 2.57%
benchmarking game assembly human-resource-machine

hrm-solutions's Introduction

Hi 👋

I’m Ateş Göral. I enjoy writing code, tinkering with graphics, experimenting with electronics, and executing ambitious DIY projects. Peek inside my head at: magnetiq.ca.

hrm-solutions's People

Contributors

18111398 avatar 837951602 avatar aaronknowles avatar alandesmet avatar atesgoral avatar caitsith2 avatar clarfonthey avatar cowboy avatar dependabot[bot] avatar eirik0 avatar eittio avatar ekx avatar gimlao avatar jdashton avatar landfillbaby avatar lezardi avatar mschordan avatar mygod avatar nanashi-juanto avatar otto42 avatar patrick-jakubowski avatar peterfreese avatar popq avatar skwasjer avatar sniperrifle2004 avatar sutch avatar unframework avatar viamodulo avatar vvolhejn avatar wolfwings avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hrm-solutions's Issues

Program runner

Utilizes either hrm-cpu or hrmsandbox to run a program against a level.

24

Here is a 11 commands & 53 steps for lvl 24 by myself (@drallieiv)

-- HUMAN RESOURCE MACHINE PROGRAM --

a:
    INBOX   
    COPYTO   0
    INBOX   
    COPYTO   1
    COPYFROM 0
b:
    SUB      1
    JUMPN    c
    JUMP     b
c:
    ADD      1
    OUTBOX  
    JUMP     a


DEFINE LABEL 0
eJzjYWBgmKDjfr7Y/OSiV1ZaPQl2W1IjHFOjzrvMDvZ1rcoUdj53GaiE4ZM5y/yVQe4LGUbBKBgFwwoA
AHzKEfk;

DEFINE LABEL 1
eJyTY2BgOKEvGwqkGI4aJGie0psf5qM3v4XdwHtJs+H8TSDxNoMUnUW2j7SEnVN0Wj1yjf55fTb75tvk
uMWPw+2zX4jfFr+IwD3e88MMLV7HLbXZkirmxFJ40m16HZuHYhtQfd8Rj70z2TwY5kQ4nlxUZ8y71FM/
YDnDKBgFo2BQAADScywL;

DEFINE LABEL 3
eJwTZGBgWGvp7vre4nHbG8tLK4BchhXWsqGSjtf8rzhJBvW7PIo46VaX0+XWXxHgIloLFK9dYd1VmmE9
uTrB7nWPh/u5pQyjYBSMgiELAByyG2I;

Question: interest in unusual solutions, even if not a record?

I was wondering: is there any desire for the addition of fun/strange/interesting/unusual solutions to puzzles, even if they aren't a record for either size or speed? (I ask, since my solution to Duplicate Removal uses a hash-table based algorithm that is quite different from the solutions already listed. I think it might be of interest to others even though it's not as good!)

Rebase and merge pre-push

@nanashi-juanto I'm rebasing and merging this branch in to prevent further divergence from master. Let me know if you had any additional commits that weren't yet pushed -- we can still rebase and get those in later.

Registry of solutions so other projects can programatically access solutions

A registry would be nice, either via a JSON file (maintained per PR) or an index.js which could return the solutions for some level n. This would let me wire up hrm-level-data, hrm-level-inbox-generator, hrm-level-outbox-generator, and hrm-solutions as a set to feed my sandbox (or any other emulator, really).

Pseudocode:

var levels = require('hrm-level-data');
var inboxer = require('hrm-level-inbox-generator');
var outboxer = require('hrm-level-outbox-generator');
var solutions = require('hrm-solutions');

levels.forEach(function (level) {
  var inbox = inboxer.generate(level.number);
  var outbox = outboxer.generate(level.number, inbox);
  if (inbox === null || outbox === null) {
    inbox = level.examples[0].inbox.splice();
    outbox = level.examples[0].outbox.splice();
  }

  // the Solution Registry tie-in here
  solutions.getSolutions(level.number, function (solution) {
     // execute `solution`
     var results = hrm.execute(solution, { inbox: inbox, variables: level.floor.tiles.splice() });
     if (!testOutboxes(results.outbox, outbox)) {
        // bad
     }
  });
});

Simulator is sorting numbers as strings

The simulator is incorrectly showing sort solutions as failing, because it is sorting 10 before 2:

input:
[ 7, 10, 6, 6, 5, 7, 6, 2, 4, 0, 'M', 'K', 'R', 'W', 0, 3, 2, 5, 5, 10, 3, 6, 5, 7, 8, 0 ]
expected:
[ 10, 2, 4, 5, 6, 6, 6, 7, 7, 'K', 'M', 'R', 'W', 10, 2, 3, 3, 5, 5, 5, 6, 7, 8 ]
actual:
[ 2, 4, 5, 6, 6, 6, 7, 7, 10, 'K', 'M', 'R', 'W', 2, 3, 3, 5, 5, 5, 6, 7, 8, 10 ]

One solution is to remove 10 from the test pool. Another is to fix the problem.

Programatically check solutions

Hi - I'm really not sure that an issue is the best way to communicate this, but just wanted to say that if you want to programatically check the solutions, I made a runtime that executes HRM asm files in javascript:

https://github.com/nrkn/hrm-cpu

See the test folder to see how you would batch check multiple solutions - I'm currently testing against my own (admittedly feeble) solutions

Requires node >=4.12

84 step solution to 20-Multiplication Workshop

I have an 84 step solution to 20-Multiplication Workshop. I'd like to submit it, but when I try to create a PR using GitHub desktop, I get:

Sync failed to push local changes
It seems you do not have permission to push your changes to this repository.

I'm new to github, and I'm probably doing something incorrectly. I've cloned the repo, created a branch, and commited my local changes to the branch. Should I be able to create a PR at this step?

Hosting "normal" solutions

This repo started off with standard solutions I came up with for all levels, without necessarily meeting or exceeding the size and speed challenges. I set it as a goal to make this into a collaborative space to push the boundaries of size/speed optimizations, and it has been going really well so far :) But, I'm also a little bothered by the fact that there's no longer any room for any "normal" solutions that could help people with learning about algorithms and get unstuck in the game.

I can think of 2 options:

Option A:
Continue with hosting just size/speed optimizations.

Option B:
Find a naming convention / folder structure to also host several "normal" solutions (like both a bubble sort and a selection sort alternative to 41 Sorting Floor)

Any suggestions?

19. Countdown Speed

(Wasn't sure how to submit but this gets the speed completed)

-- HUMAN RESOURCE MACHINE PROGRAM --

a:
b:
    INBOX   
    JUMPN    c
    JUMP     e

c:
    COPYTO   0

d:
    OUTBOX  
    BUMPUP   0
    JUMPN    d
    JUMPZ    g

e:
    COPYTO   5

f:
    OUTBOX  
    BUMPDN   5
    JUMPN    b
    JUMP     f

g:
    OUTBOX  
    JUMP     a

gh-pages

Could have better looks than the README.md, and could allow dynamic features like pulling in level info from hrm-level-data, and even the ability run programs right inside the browser.

Look into recovering overwritten solutions

Prior to the naming convention of including the author in the filename, we had been accepting PRs that simply overwrote existing solutions. It could be very tedious task, but it would be nice to recover old solutions (especially the "normal" ones).

24-Mod-Module.size.speed.asm

I am new to github and am very confused. I'm still trying to figure out how to do everything.

This does it in 11 commands and 53 steps.

-- HUMAN RESOURCE MACHINE PROGRAM --

a:
INBOX
COPYTO 0
INBOX
COPYTO 1
COPYFROM 0
b:
SUB 1
JUMPN c
JUMP b
c:
ADD 1
OUTBOX
JUMP a

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.