0 Members and 2 Guests are viewing this topic.
In other news, Frey continues kicking unprecedented levels of ass.
Quote from: Freyaday on September 19, 2011, 07:44:24 pmAlso, there are things that can only be done with a goto, like starting a program over.Depends on how it's structured. If you make the whole thing out of nested loops the right way, you can jump back to the being without a goto. A great example of this is tifreak's Sprite-2-Hex program. The whole thing is constructed out of nested While loops. When a menu item is selected, it runs a specific While var=value loop with that routine, then sets or resets the var as necessary to jump to the beginning, another routine or quit.
Also, there are things that can only be done with a goto, like starting a program over.
Actually, I emailed the teacher about it and he said I could skip the chapter! I took the exact same class
...I don't like BASIC.~ducks tomatoes/rocks surely being hurled~I just mean, in order to introduce people to programming, you don't HAVE to use it. Show them console programs, echoing, then adding, then doing Fibonacci numbers, then blackjack... it's really not any more "fancy" than Basic if you're doing it right. (Just don't do Visual Whatever - those are the worst!)Then, you can tell them more about how each thing is working lower down - maybe just gloss over compilation with something like, "What you type gets converted from English to numbers that the computer can understand" - since, for one function programs, that's pretty much all that's involved (what's a optimizing compiler?)...You can delve as deep as you need to, but it's important to give people something they can work with at the same time. BASIC's syntax has also become a little arcane. Start them with C/C++/Java/Python, I say.
>>> a = [1, 1]>>> b = [a, a]>>> b[[1, 1], [1, 1]]>>> b[0][0] = 2>>> b[[2, 1], [2, 1]]