First things first: 1+1 and "Hello World"

From Cuis CookBook
Jump to navigation Jump to search

Once you have Cuis running you may well ask yourself 'And now, what do I do?'. The short answer is, open a Workspace.

I an empty area of the screen do LeftClik, a menu will appear, select Open, anohter menu pops up, select Workspace.

Now you should see this.

Hello-world.png

Computing 1+1

  • Click into the Workspace window
  • Type 1+1. , attention, the dot at the end matters.
  • The cursor should blinking be at the right of the final dot.
  • Press Ctrl+p (in Linux, Cmd+p in the Mac), you should see at the right appear 2, hightlighted.
  • Good! You made your first computation!
  • Now what ?
  • You can press the delete button and the result gets cancelled
  • OR, You can press Ctrl+Shift+' and the result gets surrounded into "...", that means it is commented, you can keep it there like that, it is going to be ignored by Cuis.

And now the classic: "Hello World"

  • Move a few lines below your previous calculation.
  • Type 'Hello World'.
  • The cursor should blinking be at the right of the final dot.
  • Press Ctrl+p (in Linux, Cmd+p in the Mac), you should see at the right appear 'Hello World', hightlighted.
  • Good! You got the computer tell you "Hello World".
  • Now what ?
  • You can press the delete button and the result gets cancelled
  • OR, You can press Ctrl+Shift+' and the result gets surrounded into "...", that means it is commented, you can keep it there like that, it is going to be ignored by Cuis.

Exercises

  • Compute 7 * 3. No suprises
  • Compute 123423412123123123 * 78787877878787787878. It does it! Your pocket calculator can't do that!
  • Compute 2 + 3 * 4. Hey this is wrong !!! No worries, we will see the reason behind this in another section.

Dr. Nicola Mingotti