![]() |
|
Learn the Stuck Programming Language - Thread 4: Changes - Printable Version +- Sinisterly (https://sinister.ly) +-- Forum: Coding (https://sinister.ly/Forum-Coding) +--- Forum: Coding (https://sinister.ly/Forum-Coding--71) +--- Thread: Learn the Stuck Programming Language - Thread 4: Changes (/Thread-Learn-the-Stuck-Programming-Language-Thread-4-Changes) |
Learn the Stuck Programming Language - Thread 4: Changes - Shebang - 08-24-2015 Syntax();
Learn the Stuck Programming Language - Thread 4: Changes Click here for Thread 1 Click here for Thread 2 Click here for Thread 3 Table of Contents
Chapter 1: Preface This thread is essentially going to be going over the many changes I've made to the Stuck programming language since the last few threads. If you don't know what Stuck is, or you want to download the interpreter, go here. Chapter 2: Looping Two new looping functions have been implemented, a "do this x times" function and a while loop.
Chapter 3: Variable Storage Now, if necessary, you can use a variable stack to store values that you need to keep later. This can be shorter in some cases than just duplicating a value you need to use for calculations, then rotating the stack around, but from what I've found so far from small examples is that is not always the case.
Chapter 4: Other Improvements
Chapter 5: A Few Examples If you would want a list of the first 100 primes, you could use: Code: 100R_'v:fThis would create a list of numbers [1,100], duplicate it, map that list to a bunch of True or False values corresponding to the prime-ness, then filter the first list of numbers by this second list. Alternatively, you could use: Code: 100R"_v;0?":UWhich creates a list of number [1,100], and for each one, returns itself if prime or 0 if not, and the use U to remove all the falsy values (i.e. zeroes). Another example is a new way to do the Fibonacci sequence. Code: 0 1"_@p+"iV |