Programming Challenge #1 - Learn Euphoria in half an hour or less!

in #programming5 years ago

OpenEuphoria_logo.png

In my previous post, I shared a philosophy and instruction on how to learn nearly any programming language in half an hour or less, and blindly selected Elixir as my trial run. So far, so good! Today I'll really be putting this to the test with OpenEuphoria. Weird name, heard of the language, never used it, so let's see if I can do it!

I've already downloaded and installed the Euphoria tool chain; Seeing is how there's no REPL or bundled IDE, I went ahead and set up a little batch file to run the program.

Just to reiterate, what I'll be doing is learning how to structure my program, and demonstrate the use of loops, variable creation, arithmetic, functions, and console I/O. That's enough to get started in any language, as it's been shown that those are enough to be turing-complete. So let's go!

10:20 PM - Began challenge. Initializing variables as follows:

integer x, y, z

Okay, not bad. That's literally all my file consists of. I like it so far.

10:23 PM - With the combination of the example on the front page and this little tutorial my current program covers loops, creation, arithmetic, and console output.

integer x, y, z

x = 0
y = 10

while x < 10 do
 printf(1, "Value of x: %d\n", x)
 x = x + 1
end while

10:27 PM - Thanks to Rosetta Code I know how to get both string and numeric input. That's... Wow. Ridiculously easy. Source file is now:

include get.e 

atom n

integer x, y, z

x = 0
y = 10

n = prompt_number("How high do you want to get: ",{})

while x < n do
 printf(1, "Value of x: %d\n", x)
 x = x + 1
end while

10:31 PM - Thanks again to TutorialsPoint I've learned how to create functions. At this point, I've completed the challenge. My final code is as follows:

include get.e 

atom n

integer x

x = 0

n = prompt_number("How high do you want to get: ",{})

while x < n do
 reportNumber(x)
 x = x + 1
end while

function reportNumber(integer numb)
    printf(1, "Value of x: %d\n", numb)
    return 1
end function

While it doesn't look like much, it shows everything needed to get started in the language. Honestly? That was almost too easy. I really enjoyed working with Euphoria - It's clean, it's simple, and there's not a whole lot of overhead trying to even get STARTED writing a program. The installer itself was 10 MB, and there weren't a lot of hurdles in getting the structure for the program going. I didn't even need to worry about whitespace!

Shoutout to @leprechaun for suggesting Euphoria - it was pretty fun to learn! Honestly I suggest my readers to check it out sometime. It's a very simple, no-nonsense language, and learning the basics... takes about ten minutes. Thanks for the challenge; if anyone has any other suggestions, throw them my way!

Thanks for reading; and as always, feel free to throw any suggestions my way. Don't forget to check out my previous post where I show how it's possible for anyone to learn any programming language in half an hour or less!

Sort:  

Hello! Your post has been resteemed and upvoted by @ilovecoding because we love coding! Keep up good work! Consider upvoting this comment to support the @ilovecoding and increase your future rewards! ^_^ Steem On!

Reply !stop to disable the comment. Thanks!

I am glad you liked Euphoria. There is also a manual installed. It should install documentation to c:\Program Files\euphoria\doc and the HTML version lets you look up functions or procedures in snap!

It doesn't look like a viable source code of a deity that transforms human souls. Where is the soul-scanning part?

Coin Marketplace

STEEM 0.29
TRX 0.12
JST 0.033
BTC 63855.79
ETH 3113.00
USDT 1.00
SBD 4.04