Friday, April 11, 2014

Problem 81 - Dogescript

The languages I have used in this blog have come from a number of sources. Many I had just heard of through word of mouth prior to working on this project (everyone has heard of many languages, even those not popular today like Fortran, BASIC, etc, even if they have no vague interest in working with them). Some I have found through searching lists of popular programming languages, languages that have some use but aren't overly famous were generally found this way, like D. The more esoteric languages, however, generally have to come out of either searching the interwebs on my part or from the suggestions of others. Today's language came as a suggestion from a friend of mine, this is her second suggestion, the first being the as-of-yet unused nyanscript which is basically a textual replace of brainfuck. Today's language is much less painful to use than brainfuck however, it is dogescript, a language based on that popular meme. I am a bit disappointed with the language, due to its lack of creativity (it is just a textual replace of javascript, but many things are left untranslated, thus the subtraction symbols, +=, and square bracket array accesses. Maybe in the future the language will more fully grow into its own, but for now , solving this problem in dogescript really just felt like solving it in javascript with a couple of very minor obstacles. My largest speed bump in solving this problem was spending a long time not knowing why my answer was wrong, only to find that I had computed the maximal path sum, when the minimal path sum was desired. Compiles and runs in about 1s on my machine.
very matrix is new Array
very row   is new Array with 4445 2697 5115 718 2209 ...
matrix dose push with row
...

shh Full table description in actual solution file, cut short here 

such max much x y
    very r is x
    rly x smaller y
        r is y
    wow
wow r

such min much x y
    very r is x
    rly y smaller x
        r is y
    wow
wow r

very numdiags is 160
very bigindex is 79
much very diag as 1 next diag smaller numdiags next diag more 1
    very hbound is plz min with diag bigindex
    very lbound is diag - bigindex
    lbound is plz max with 0 lbound
    much very col as hbound next col biggerish lbound next col less 1
        very row is diag - col
        very lparam is matrix[row][col]
        rly row bigger 0
            lparam += matrix[row-1][col]
        but
            lparam += 10000000
        wow

        very rparam is matrix[row][col]
        rly col bigger 0
            rparam += matrix[row][col-1]
        but
            rparam += 10000000
        wow
        matrix[row][col] is plz min with lparam rparam


    wow
wow

java.lang.System.out dose println with matrix[bigindex][bigindex]


No comments:

Post a Comment