
-----------------------------------
Tony
Sun Oct 23, 2011 9:25 pm

[Tutorial] picture guide on how to use a command line to run programs
-----------------------------------
as a followup to @mirhagk, see if you can follow along.

1. Open up your favourite code editor. Mine is TextMate.
http://i.imgur.com/z2Bgj.png

2. Type up your program.
http://i.imgur.com/411Xk.png

3. Save it where-ever you want.
http://i.imgur.com/TcwgY.png

4. Open up your favourite shell. Mine is bash via Terminal.app
http://i.imgur.com/z2Bgj.png
http://i.imgur.com/0nC1I.png

5. Type the name of your favourite interpreter/compiler. Mine is Ruby.
5.1 Followed by this magic (drag-and-drop source into terminal).
http://i.imgur.com/NXGgt.png
http://i.imgur.com/qsORX.png
http://i.imgur.com/l2bNy.png
http://i.imgur.com/Yb7i9.png

6. Hit Enter. BAM, you're done!
http://i.imgur.com/zEVvM.png

-----------------------------------
Dan
Mon Oct 24, 2011 8:14 am

RE:[Tutorial] picture guide on how to use a command line to run programs
-----------------------------------
Or the no GUI at all version:

Open file for editing in your favorit command line editor:
http://compsci.ca/~dan/ruby1.png

Type in code and hit save key:
http://compsci.ca/~dan/ruby2.png

Run using your favorit complier (noramly:  ):
http://compsci.ca/~dan/ruby3.png

Receive output or executable (depending on if code was interpreted or compiled):
http://compsci.ca/~dan/ruby4.png



Also for ruby you can forget about the file all together and just type "ruby", put some code in and hit "ctrl-d" when done and it will run it. Or even better use the interactive shell tony mentioned in the other topic  :wink:

-----------------------------------
mirhagk
Mon Oct 24, 2011 10:37 am

RE:[Tutorial] picture guide on how to use a command line to run programs
-----------------------------------
Well there ya go, now I may steal these, and give students the option of choosing between them. So I assume both of you think that ruby should be the language taught?

-----------------------------------
Tony
Mon Oct 24, 2011 10:49 am

Re: [Tutorial] picture guide on how to use a command line to run programs
-----------------------------------
Type the name of your favourite interpreter/compiler.
You may pick any other language.

-----------------------------------
Dan
Mon Oct 24, 2011 10:50 am

Re: RE:[Tutorial] picture guide on how to use a command line to run programs
-----------------------------------
Well there ya go, now I may steal these, and give students the option of choosing between them. So I assume both of you think that ruby should be the language taught?

Depends on what you are trying to teach. I recomend basing the language on what best demonstrates the concepts.

Python and Ruby both have good potential for teaching the basics up to object oriented programming, but i would probably go with somthing like C for data structures. More domain specific topics offten have less popular langues targeting them and what langue maybe used for a class is offten limited by the libraries and tools the instructor wishes to use.

-----------------------------------
mirhagk
Mon Oct 24, 2011 11:11 am

RE:[Tutorial] picture guide on how to use a command line to run programs
-----------------------------------
Well grade 10 goes over if statements, looping, variables, arrays and functions/procedures. It never really gets into classes and stuff (right now). Basically the class is to give students an introduction on how to program, not necessarily teach them anything useful about programming, other than what it is and basic concepts.

Since grade 11 has no pre-req there's not a lot that we can teach in grade 10, since it needs to be retaught next year anyways.
