Coder Social home page Coder Social logo

tkellehe / noodel Goto Github PK

View Code? Open in Web Editor NEW
10.0 3.0 0.0 557 KB

A programming language designed around supporting ASCII animation based code golfing challenges.

JavaScript 97.69% CSS 1.14% HTML 1.17%
golfing-challenges programming-language language challenge stack ascii-art ascii-text stack-based browser javascript

noodel's Introduction

Noodel

<script src="https://code.jquery.com/jquery-3.1.1.min.js" integrity="sha256-hVVnYaiADRTO2PzUGmuLJr8BLUSjGIZsDYGmIJLv2b8=" crossorigin="anonymous"></script> <script src="noodel-latest.js"></script> <script type="text/javascript" src="docs.js"></script>

Noodel is a programming language that has the main focus of assisting ASCII Animation code golfing challenges. Noodel has its own 256 character set. There also is an editor designed for Noodel that utilizes its JavaScript parser here.



Since the language is for challenges visit the issues page and post challenges where Noodel was used. This will allow others to learn how to Noodel as well as notice features that could be added to assist with challenges (Learn more). This language is still under construction and since I like to code for Noodel from the online editor things may randomly break in the prototyping editor, features disappear/change, zero comments made on commits, or random issues appear for myself. If there is a need to use an older version of Noodel that was good enough before, visit the release directory for a list of all of the versions.

Introduction

Noodel has three main data types: NUMBER, STRING, and ARRAY. ARRAY objects are always passed-by-reference, but the others are passed-by-value (...)

A "Hello World" in Noodel is pretty simple: Hello,¤World!

The STRING literal is created and placed onto the stack which can be done with any of the printable characters. At the very end, whatever is on the top of the stack gets printed. Therein, the Hello,¤World! gets printed. But what happened to the ¤? The ¤ is used to represent a space when handling STRING types. This allows for the space character to act as a NOP to seperate commands. The same was done with the line feed character which is represented by (...)



The Memory Model

Noodel is a stack-based language with a slight twist. The perspective of the stack can be changed. A simple example of this is if you need to store an object for later but do not want it to be operated on, you can move the top of the stack down. For example: noodelʠsome¤workƥ



The literal noodel gets pushed onto the stack, then the top of the stack gets moved with the ʠ command. Then the STRING literal some¤work gets pushed onto the stack. The command ƥ moves the top of the stack back up, therein noodel is on top and is printed.

Now that is kind of cool, but it gets more interesting when there are arrays involved. Let us take this script: ¤noodel¤ȷçıḷẹḍe



It produces the same output as the script ¤noodel¤ḷçẹḍe, but takes advantage of the fact that ARRAY types are pass-by-reference. So, first ¤noodel¤ is pushed onto the stack. Since the stack is merely an ARRAY, we call the ȷ command which jumps out of the current stack and into the containing stack. The top of this new stack is the stack with the STRING literal. So, we print it to the screen using ç therein the ARRAY object is sitting in the stdout. Then we call ı command to jump into the ARRAY at the top of the stack to make it the current stack. This allows us to now start operating on the STRING live. Instead of jumping out, printing, and then jumping back we can use Ð which pushes the current stack to stdout: ¤noodel¤Ðḷẹḍe



noodel's People

Contributors

tkellehe avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

noodel's Issues

Editor html

Move the HTML for the code editor into the docs.js. And only have a single div in the readme to know where to put the editor. Also, maybe have parameters that let you set the code.

Casting For Arrays

If stringify or numberify an array should do it to the elements in the array.

Pretty Print

Add some command that modifies a string based off a particular option. Such as left align, right align, and centralize.

Animation Operator

Make the capital animation (a with dot on bottom) index and throw away and not save the frame.

Smart String Construction

Need to find a neat way to stack printing. As in, if wanting to do snowmen:

(.,.) (.,.)
( : ) ( : )

Which code wise would look:
“(.,.)¤(.,.)¶(¤:¤)¤(¤:¤)
But, something better:
“(.,.)¤¬(¤:¤)¤²⁺
Essentially a string could have some kind of row capability.

Failing Silently

Instead of commands failing silently, they should throw an error since it is now supported.

Break Capital

For a the break command if it is capital will only break if the front of the pipe is a falsy value and will consume.

Cycling pipe

Have where the command to print item work with arrays by storing a last read position with the array and moding by the size of the array. Then prints that index. This command should be the "a" with a dot. Then add access to the types string and array.

Piping Data

Use the ¦ to represent the piping of data. If used by itself, then it will pipe everything to the next ¦. If µ¦ is used then whatever is in the pipe will be integerified and that number of things will be let through. If ¦<integer> is used then that value will pass through.

Modularize More

Break out noodel.js into noodel.js which just defined the basic functionality. Then noodel-basic.js which will have all of the basic commands.

Commands

Add where can have list off functions to run for the exec call. (Make list accessible)

Char codes to chars

Remove the char codes used in the noodel parser. Do this by adding a correct function to characters in order to prevent the bug where add news character to front.

Command update

Need to update the string commands to use regex instead.

Delay Commands Parsing Error

Did not update the end of the command for the delay functions. This means that the new number Literals will parse those numbers again.

Stringify

Use the s or ' to stringify something.

Comparison

Let the small equals be comparing the first two values in the pipe and if true then drop one and push on a number 1. If false leave both and push on a zero.

Arrays and Operands

Arrays need to be done by reference for later stuff since is complex object. So, for Operands that duplicate instead edit in place and then return self.

Simple Regex Issue

The regex strings need to be updated to support js strings. Because the \ is escaping characters.

Global

Remove the global prgm so can have multiple programs on same page.

Count Command

Add new command that gets the count from the containing loop and places it into the pipe.

Rotate front and back

The same ė that works on the pipe by taking the front and putting it into the back, have the same that acts on strings and arrays. For numbers, take the reciprocal?

Regex

Add regular expressions and have hem start with r with dot on bottom. Have where can use printables then change to corrected stuff (printify it so the regex in JS will work)

Tokens and Paths

Have token hold a reference to the parent path. Also, have paths have parents as well.

Changing output

Change the output of the editors such that can color text. Does not need to be a textarea because cannot edit the output.

Basic Compressing is Broken

For some reason, the basic compression is producing noncompressable characters.
characters.compress_basic("_o_¬¤0¤¬/¤\\ð\\o/¬_0_") => Ṫg--ḌɦȮA*⁹$⁵Ż¬Ṡk-

Character Array

For the character array, make it to where it splits by char if no block character is in the string else make an array based on the block character. Also, remove the compression ability from this command to be used on more complicated compressions.

Strict Mode

Maybe failing silently was not such a bad idea... Could add a command to toggle strict mode?

Number Range

Replace ½ with in order to have range capabilities. This will create a range of numbers as an array. Using mu will pull from the pipe.

Make commands lookup

Have commands be regex instead of just a simple comparison. This will allow for more complicated commands.

Break Error

For some reason the break command is not working if it is the end of the program.

Params Position

Params need to store their index into the captured string. Also, need to store the captured string.

Rotating Arrays and Strings

Add to the e with dot on bottom to account for if have the row formatting and new string block formatting.

Array Literals

Use the ( tiny version to represent the start and the closing for the end. Each element is deprecated by the bar with a missing spot in it. Can use mini numbers to repeat element. Also, need a syntax to reprent what indecis? Also, need a way the can get the number of times to repeat from the pipe.

Inputs with spaces

Cause inputs coming in as spaces to be turned into the proper splat thing.

Add Arrows

Add arrows to character selector beside the backspace button.

Char Selector

Make to where the selector is a large 2d box that can be hidden.

Try Catch

Add try catch blocks that consume everything up to a catch? Then a catch up to a finally? Then finally until end of line or program.

Exception Handling

Add a Pipe to paths called exceptions that will be checked at the end of every step which can cause the prgm to end. Merely, append it to the outputs.

Character Selector Issue

When appending a character after the characters that are not "printable", some how get placed before where they were supposed to be.

Remove CHAR

Need to remove the CHAR type because it now does not seem very useful.

Text Compression

The simplest text compression should be where it pushes in on a bit. So, let the first 97 values (0-96) be the printable characters then merely push in one of the bits. This means every 7th character could be removed. Also, this means can have the last ~31 characters be ones that are not used in the string Literals:)

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.