Ring Documentation Walkthrough #2 – Hello, World!

At the previous part i talked about downloading the official release for windows, this part i will start in programming with Ring. (Video is coming soon)

Hello, World!

to print a message like ‘Hello, World!’ we use the words ‘See‘ or ‘see‘ or ‘SEE‘ all will do the job.

see 'Hello, World!'
See 'Hello, World!'
SEE 'Hello, World!'

Output :

Hello, World!Hello, World!Hello, World!

Yeah i know, why they’re beside each other, it’s simple actually. You just need to add one more thing at the end of your text … like this:

see 'Hello, World!' + nl

nl means a newline, then our output will become:

Hello, World!
Hello, World!
Hello, World!

Multiline text:

see "Hello
It's me."

Output:

Hello
It's me.

Comparing to Python this is the print function, so what about the raw_input/input ?

we use the word “give” to get user’s input:

see "What does 5 + 10 equal ?" + nl
give answer
see "Your answer is " + answer

easy .. ha?, well .. in Ring we can make it more easier like this:

see "What is the purpose of life ?" + nl give answer see answer

Yes, just like that!. Test it yourself and compare the results.
amrESSAM.

Advertisements

2 thoughts on “Ring Documentation Walkthrough #2 – Hello, World!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s