Euphoria is a kewl programming language for dos, windows, and various linuxes. I'd characterize it as a starting point for an "artificial intelligence" language, like Scheme, Lisp, Prolog, Smalltalk, etc., but it doesn't quite get there in native functions. It is useful as a general purpose programming language. Euphoria is basically a msDos32 application, altho with the various include files, it is internet-able and gui-able. Check out the recent user contributions page and archives pages on the RDS home page for all the optional include files. Euphoria is an interpreted scripting language first, but also has a script-to-C translator, and the C code can be fed to any C compiler you prefer (3 are recommended, and it's optomised for one).I use Textpad as my main scripting editor, found at http://www.textpad.com/. The Euphoria syntax file can be found at http://www.textpad.com/add-ons/files/syntax/euphoria.zip. There are 100's of other languages with syntax file too.
Here's my collection of code:
BigNum
[EuBot]
StrTok
create_directory
Sockets Code for Mirc
This is a string-based basic math library, supplying addition, subtraction, multiplication, and division, a few boolean operations (plus a few other math operations) on stringed numbers. Syntax is easy: junk = seq_multiply(num_1,num_2), where num_1 and num_2 are of the form "(+ or -) 12345.6789" of any length. There are optimisations and shortcuts for speed, and some string operations for readability, like adding commas or deleting trailing zeros. European and usa forms of numbers (1,234,567.56 and 1.234.567,56) are supported.It's PRE_RELEASE version 0.8 , but it seems to work. Let me know on the Eu list if it doesn't. The readme.txt is quite terse, and in the zip.
Download bignum-v1.e here.
[EuBot] is 100% Euphoria, which connects to irc servers with tcp4u. It's online right now. Well, it's online unless i have it off for new code, i plan on adding new options, when i get a Round Tuit. It's now in version 0.13, runs in a dos box, and has no keybd or mouse input (except for 'q' to quit).Read about it here.
Download it here.
Strtok-v2-1.e is the latest version of strtok functions as i have used for years in mirc. It's NOT the C or PHP strtok() function, mine is a family of functions. It's a great tool to break up strings and smallish databases into their components, like getting fields from common comma-delimited databases. Or turning a sentence into it's collection of words, to be accessed as words, and not as a long sequence of characters. This version has a few more commands, and some more useful options, than the original strtok version circa 1999. Parse is much faster, deparse is faster too. Sorttok() is now working, sorting tokens in ascending and descending order, and both at once, great for munging small databases like comma delimited files, see the readme. There are also *ntok() functions for returning the index of the token you seek, or the tokens as re/ordered, instead of returning the token itself. New is striptok(), for trimming off leading and/or trailing tokens.
Other people have looked into the code, made suggestions, and contributed code, and they are mentioned in the readme two files (text and html). I update this file as needed.
Readme for version 2.1 here.
Read the plain text 2.1 readme here.
Readme for older v2 here.
The zip files include source code and the readme files.
Download strtok-v2-1.e here.
Download strtok-v2.e here.
(These are zip files, get winzip here)
create_directory is a handy lil procedure i dreamed up. The wonderful thing about this procedure is that you can pass it a full-length path, and it will make it, unlike mkdir and the kernal32.dll's CreateDirectoryA(), both of which make one level, and one level only, and both will barf if you pass them more than one level. I provide two versions of the procedure, one for DOS and one for windose. Travis has written a version for Linux. Using system(mkdir..) in windows will open a dos box, and then close it, but it works, and is fine in dos. The windows one doesn't open any boxes. I have not personally run the Linux version.Read the procedure online.
This program connects mirc to Euphoria and vice versa. I wrote it years ago, for mirc v5.51, and fairly ancient versions of win32lib and Euphoria. I got a lot of help on the Eu listserv for the win32lib and winsock code. Now if i could get help with making it work with more recent versions of mirc and win32lib? This package will connect not only to mirc on your computer, it can also connect to the irc server directly (code not included), or to another computer on your LAN or across the internet. Since it is async, it as the potential to allow several connections at once, like an ircd or httpd does. I chose to use mirc as the gui/frontend because mirc is so easy to script and make guis with. This is an ideal (imho) to make a bot on a winbox, you can leave the mirc portion connected, and kill/restart the Eu portion as needed (for Eu coding changes or whatever) and mirc makes the human-irc interface easy. The standard mirc aliases are available to Eu, and you can make databases and data manipulation in Eu that mirc takes forever to do. Plus mirc executes strings, which you can make in Eu, and pass to mirc for execution, making scriptable databases easy and fast.I am no longer supporting this! And it has unfixed bugs, and doesn't actually *do* anything productive.
Contact Mario on the Eu listserv, or in the #Euphoria channel on Sorcery.net (irc.sorcery.net) for up-to-date code.
|
(as one demo in designing webpages and internet functionality) |