<commit_before>-- HUMAN RESOURCE MACHINE PROGRAM --
--
-- Level:   38
-- Name:    Digit Exploder
-- Variant: Broken
--
-- Size:   N/A
-- Target: 30
--
-- Speed:  N/A
-- Target: 165
--
-- AVAILABLE COMMANDS:
-- INBOX
-- OUTBOX
-- COPYFROM
-- COPYTO
-- ADD
-- SUB
-- BUMPUP
-- BUMPDN
-- JUMP
-- JUMPZ
-- JUMPN
-- COMMENT
-- 
-- PREFILLED TILES:
-- [ 9]   0
-- [10]  10
-- [11] 100
--
-- In-game Description:
-- Grab each number from the
-- INBOX, and send its digits
-- to the OUTBOX. For example,
-- 123 becomes 1, 2, 3.
--
    -- some notes to help here
    
    -- some tiles have special meanings
    -- tile  4 - swap           ( swap)
    -- tile  6 - ones count     (  ct1)
    -- tile  7 - tens count     ( ct10)
    -- tile  8 - hundreds count (ct100)
    -- tile  9 - CONST   0      (    0)
    -- tile 10 - CONST  10      (   10)
    -- tile 11 - CONST 100      (  100)
    
start:
    -- initialization
    COPYFROM  9                 -- hands = 0;
    COPYTO    8                 -- ct100 = hands;
    COPYTO    7                 -- ct10  = hands;
    COPYTO    6                 -- ct1   = hands;
    INBOX                       -- hands = in();
    COPYTO    4                 -- swap  = hands;
    
    -- count hundreds
hundred:
    SUB      11                 -- hands = hands - 100;
    JUMPN    hundredcleanup     -- if (hands < 0){goto hundredcleanup;}
    COPYTO    4                 -- swap = hands;
    BUMPUP    8                 -- ct100++; hands = ct100;
    COPYFROM  4                 -- hands = swap;
    JUMP     hundred            -- goto hundred;
hundredcleanup:
    ADD      11                 -- hands = hands + 100;

    -- count tens
ten:
    SUB      10                 -- hands = hands - 10;
    JUMPN    tencleanup         -- if (hands < 0){goto hundredcleanup;}
    COPYTO    4                 -- swap = hands;
    BUMPUP    7                 -- ct10++; hands = ct10;
    COPYFROM  4                 -- hands = swap;
    JUMP     ten
tencleanup:
    ADD      10                 -- hands = hands + 10;
    
    -- count ones
    -- we're holding them
    COPYTO    6                 -- ct1 = hands;
    
    -- output
    COPYFROM  8                 -- hands = ct100;
    OUTBOX                      -- out();
    COPYFROM  7                 -- hands = ct10;
    OUTBOX                      -- out();
    COPYFROM  6                 -- hands = ct1;
    OUTBOX                      -- out();
    
    -- end loop
    JUMP start<commit_msg>HRM 38 - solved - non optimized solution<commit_after>-- HUMAN RESOURCE MACHINE PROGRAM --
--
-- Level:   38
-- Name:    Digit Exploder
-- Variant: Solve
--
-- Size:   34
-- Target: 30
--
-- Speed:  228
-- Target: 165
--
-- AVAILABLE COMMANDS:
-- INBOX
-- OUTBOX
-- COPYFROM
-- COPYTO
-- ADD
-- SUB
-- BUMPUP
-- BUMPDN
-- JUMP
-- JUMPZ
-- JUMPN
-- COMMENT
-- 
-- PREFILLED TILES:
-- [ 9]   0
-- [10]  10
-- [11] 100
--
-- In-game Description:
-- Grab each number from the
-- INBOX, and send its digits
-- to the OUTBOX. For example,
-- 123 becomes 1, 2, 3.
--
    -- some notes to help here
    
    -- some tiles have special meanings
    -- tile  4 - swap           ( swap)
    -- tile  6 - ones count     (  ct1)
    -- tile  7 - tens count     ( ct10)
    -- tile  8 - hundreds count (ct100)
    -- tile  9 - CONST   0      (    0)
    -- tile 10 - CONST  10      (   10)
    -- tile 11 - CONST 100      (  100)
    
start:
    -- initialization
    COPYFROM  9                 -- hands = 0;
    COPYTO    8                 -- ct100 = hands;
    COPYTO    7                 -- ct10  = hands;
    COPYTO    6                 -- ct1   = hands;
    INBOX                       -- hands = in();
    COPYTO    4                 -- swap  = hands;
    
    -- count hundreds
hundred:
    SUB      11                 -- hands = hands - 100;
    JUMPN    hundredcleanup     -- if (hands < 0){goto hundredcleanup;}
    COPYTO    4                 -- swap = hands;
    BUMPUP    8                 -- ct100++; hands = ct100;
    COPYFROM  4                 -- hands = swap;
    JUMP     hundred            -- goto hundred;
hundredcleanup:
    ADD      11                 -- hands = hands + 100;

    -- count tens
ten:
    SUB      10                 -- hands = hands - 10;
    JUMPN    tencleanup         -- if (hands < 0){goto hundredcleanup;}
    COPYTO    4                 -- swap = hands;
    BUMPUP    7                 -- ct10++; hands = ct10;
    COPYFROM  4                 -- hands = swap;
    JUMP     ten
tencleanup:
    ADD      10                 -- hands = hands + 10;
    
    -- count ones
    -- we're holding them
    COPYTO    6                 -- ct1 = hands;
    
    -- output hundreds
    COPYFROM  8                 -- hands = ct100;
    JUMPZ    outten             -- if (hands == 0){goto outten;}
    OUTBOX                      -- out();
    
    -- output tens
outten:
    COPYFROM  7                 -- hands = ct10;
    JUMPZ    tenzero            -- if (hands == 0) {goto tenzero;)
    JUMP     tenneedsout         -- goto tennonzero;
tenzero:
    SUB      8                  -- hands = hands - ct100;
    JUMPZ    outone             -- if (hands == 0) {goto outone;}
    COPYFROM 7                  -- hands = ct10;
tenneedsout:
    OUTBOX                      -- out();
    
    -- output ones
outone:
    COPYFROM  6                 -- hands = ct1;
    OUTBOX                      -- out();
    
    -- end loop
    JUMP start
{'fraction_non_alphanumeric': 0.1151012891344383, 'fraction_numerical': 0.04364640883977901, 'mean_word_length': 0.9564121037463977, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1363795', 'n_tokens_mistral': 1856, 'n_tokens_neox': 1626, 'n_words': 520}