: : C y r e k S o f t : :

* Home


* Tools

+ Games + GNU bc + Interesting + Stuff + Links

Euphoria Experimental

This page will showcase any of coding exercises I set myself just to see if I can still come up with a decent algorithm.

Currently, there's only NFor and a Binary Search here. This might change if I get a concept in my head that screams to be coded.

NFor - (Say: "en-for") - An attempt at a new programming concept
  • nfor.e library - beta - contains test code
    Have you ever created an n-dimensional sequence, then had to write n for-loops to process it? Then you realise you need to add an extra dimension to the elements, so you have to add another for-loop to the code, etc. etc.

    nfor.e attempts to address the issue by creating all the for-loops at the same time, and closing all the loops at the same time. It isn't perfect; There's no way to do initialisations before inner loops start or after they end. To offset this, it's possible to nest nfor loops. The test code at the end of the file demonstrates this. This means that at nested-for levels where no initialisations are required, they can be bundled into an nfor, initialisations for inner loops can be done, then further fors and nfors can be done within the outer loop.

    As per usual there's no documentation yet, and some of the code hasn't been tested properly. However, the test code at the end is a fully functional example of how to use the code - run it a couple of times with and without the trace(1) to see what's going on.

Binary Search - In-order insertion of tagged strings into a data structure
  • insert.ex code
    A while back in this thread on the Math newsgroup sci.math, I participated in a discussion of an algorithm for inserting strings that had been tagged with their creation number into a data structure so that the strings would be easily searchable when the time came. After waxing lyrical about how it might be done, I thought it might be prudent to actually write the algorithm described, rather than just talk about it.

    Since the OP in the thread seemed like he was doing some sort of school assignment, this code was not posted to the group...


This site should work with most browsers
though there are some advanced features
that will only work with more recent software
  that mail thing | web{}phodd.net