1. hello nice to be here i'm new here

hello nice to be here with you all...

I'm ron I'm from Israel a hobby programmer I've started learning to code and to program 7 or 8 years ago I started with vb.net, then tried other languages such as python and javascript in the last few years I've been mostly programming in BASIC languages such as QB64 and freeBASIC but also a bit of C or Cpp i consider myself to be a bit of a "retro" coder - I have known about euphoria programming language since I heard about it 2 years ago but just now I decided to learn it well and get to code in it - I find it a good programming language not too hard but efficient and I'm curious to learn more as much as I can about it... I'm on a linux 64 bit OS and the instillation was very easy I use Geany IDE to run and compile it if necessary - I'm still at the very basic but I hope I can learn fast it since I'm familiar with basic syntax and C Cpp syntax

anyway here are two small code I coded today as a test run for euphoria :)

include std/console.e 
--include std/get.e 
 
--with trace 
--trace(1) 
 
procedure main() 
    integer target = rand(100) 
    integer guess 
    integer attempts = 0 
    --printf(1, "number is: %d\n\n", target) 
    atom true = 1 
    while true = 1 do 
        printf(1, "Guess a number between 1 and 100: ") 
        guess = prompt_number("", {1, 100}) 
        attempts += 1 
         
        if guess < target then 
            puts(1, "Too low! Try again.") 
        elsif guess > target then 
            puts(1, "Too high! Try again.") 
        else 
            printf(1, "Congratulations! You guessed the number in %d attempts.", attempts ) 
            true = 0 
        end if 
    end while 
end procedure 
 
main() 
include std/console.e 
 
procedure main() 
    sequence user_input="" 
    sequence response ="" 
     
    puts(1,"Hello! I'm your chatbot. Ask me something or say 'exit' to quit.") 
    atom true = 1 
    while true = 1 do 
        printf(1, "\nYou: ") 
        --gets(user_input) 
        --user_input = user_input[1..length(user_input)-1] 
         
        user_input = prompt_string("") 
         
        if equal(user_input, "exit") then 
            puts(1,"Chatbot: Goodbye!") 
            true = 0 
        elsif equal(user_input, "hello") then 
            response = "Hi there!" 
        elsif equal(user_input, "how are you") then 
            response = "I'm just a program, but thanks for asking!" 
        elsif equal(user_input, "what's your name") then 
            response = "I'm ChatEuphoria, your friendly Euphoria chatbot!" 
        else 
            response = "I'm not sure how to respond to that." 
        end if 
         
        printf(1, "Chatbot: %s\n", {response}) 
    end while 
end procedure 
 
main() 
new topic     » topic index » view message » categorize

2. Re: hello nice to be here i'm new here

Hello there,

Nice to see new blood joining the Euphoria community. Welcome aboard.

new topic     » goto parent     » topic index » view message » categorize

3. Re: hello nice to be here i'm new here

thanks!

here is a console game i made in euphoria...

include std/console.e 
 
constant SUCCESS = 1 
constant NEUTRAL = 2 
constant FAILED = 3 
 
global integer avishai_happy = 0 
global integer avishai_sad = 0 
global atom over = 1 
 
procedure show_results(integer result) 
      switch result do 
        case SUCCESS then 
            puts(1, "\nAvishai is happy.") 
            puts(1, "\nAnd you are happy too and you Hug him") 
            puts(1, "\nHe smiles at you without words") 
            puts(1, "\nAnd you feel Love Towards Him and From Him.") 
            avishai_happy += 1 
            break 
        case NEUTRAL then 
            puts(1, "\nAvishai is apathetic.") 
            puts(1, "\nHe is Deep Into his Autistic Apathy") 
            puts(1, "\nAt least he Is Not Crying") 
            puts(1, "\nYou look at his Sadden Wishing he was Normal.") 
            break 
        case FAILED then 
            puts(1, "\nAvishai cries.") 
            puts(1, "\nYou try your Best to Comfort Him") 
            puts(1, "\nBut in Vain He cries out Load") 
            puts(1, "\nHe cries His Poor Little Heart Out") 
            puts(1, "\nAnd you Cry Too over Both of You.") 
            avishai_sad += 1 
            break 
    end switch 
     
end procedure 
 
procedure game_turn() 
    integer choice 
 
    puts(1, "\nIt's a new day in 1988.\n\n") 
    puts(1, "Options:\n") 
    puts(1, "1. Feed Avishai\n") 
    puts(1, "2. Give him medications\n") 
    puts(1, "3. Take him to the public garden\n") 
    puts(1, "4. Play music for him\n") 
    puts(1, "5. Put Avishai to bed\n") 
    puts(1, "6. Exit the game\n") 
 
    choice = prompt_number("", {1, 6}) 
    clear_screen() 
      switch choice do 
        case 1 then 
            show_results(rand(3)) 
            break 
        case 2 then 
            show_results(rand(3)) 
            break 
        case 3 then 
            show_results(rand(3)) 
            break 
        case 4 then 
            show_results(rand(3)) 
            break 
        case 5 then 
            show_results(rand(3)) 
            break 
        case 6 then 
            puts(1, "Exiting the game.") 
            over = 0 
            break 
 
--~         else 
--~             puts(1, "Invalid choice. Try again.") 
    end switch 
    wait_key() 
    clear_screen() 
end procedure 
 
procedure opening() 
    puts(1, "DEDICATED TO MY LITTLE BROTHER\n\n") 
    puts(1, "           AVISHAI\n\n") 
    puts(1, "FOREVER IN MY HEART OH BROTHER <3")  
    wait_key() 
    clear_screen() 
end procedure 
 
procedure main() 
     
    while over = 1 do 
        game_turn() 
    end while 
    printf(1, "\n\nAvishai was happy %d times.",  avishai_happy ) 
    printf(1, "\n\nAvishai was sad %d times.",  avishai_sad ) 
end procedure 
 
opening() 
main() 
new topic     » goto parent     » topic index » view message » categorize

4. Re: hello nice to be here i'm new here

hello everyone i wanted to ask you all if there is some sort of chatroom for euphoria programmers and coders like an irc channel or a discord server or a matrix channel?

new topic     » goto parent     » topic index » view message » categorize

5. Re: hello nice to be here i'm new here

well it seems there is some sort of irc channel on libera.chat however it seems not registered...

so I opened a #euphoria irc channel on freenode (as it was once there however it's now the new freenode irc network so to connect it you need to add a new network to your irc client - the server name is: "irc.freenode.net" and the port is 6697 (I'm on linux so I use hexchat client) if you are not registered on freenode with a nicj use port 6667 instead... or you can use weechat of freenode (browser)...

if there is a problem with this and the admins or openEuphoria team is against the idea you can tell me and I'll drop the channel...

ron77

new topic     » goto parent     » topic index » view message » categorize

6. Re: hello nice to be here i'm new here

My thoughts are with Avishai … thank you for this game.

Using Phix instead of Euphoria on a Win 10 machine, I had to delete the line include std/console.e — I cannot be sure that the program runs exactly the way you have intended it to, but I think it does.

What you are doing is something that I've been told here that no one else but me is still interested in, that is, writing command line / console programs. So, welcome to this forum, even if you'll probably find that people here are mostly concerned with different things, many of them beyond my understanding.

Best wishes, Robert

new topic     » goto parent     » topic index » view message » categorize

7. Re: hello nice to be here i'm new here

RobertS said...

My thoughts are with Avishai

I might be having a grandpa moment here - but who's Avishai?

new topic     » goto parent     » topic index » view message » categorize

8. Re: hello nice to be here i'm new here

jimcbrown said...

I might be having a grandpa moment here - but who's Avishai?

The "tamigoshi pet" / little brother in the game above

new topic     » goto parent     » topic index » view message » categorize

9. Re: hello nice to be here i'm new here

ron77 said...

hello everyone i wanted to ask you all if there is some sort of chatroom for euphoria programmers and coders like an irc channel or a discord server or a matrix channel?

Euphoria *was* on freenode, but that net suffered a hostile takeover, during which all channels and nicks were deleted. So Euphoria moved overnight to Libera. I thought the #Euphoria channel was registered at one point, but maybe not. One quirk of channel services is a channel can be registered only by someone who is chanop, which for an unregistered channel would be the first person to join the empty channel. You can infer a lot by there being so little cooperation that everyone will not leave it long enough for one person to re-join alone and register the room.

For what it's worth (zero), both #OpenEuphoria and #Phix have been registered almost 2 years now, and no one goes there. OpenEuphoria could register to own ##OpenEuphoria if they wished to.

I wrote a lot of irc code the last 25 years, and deleted most of it.

Kat

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu