|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Chron
Super Robot
Posts: 2790
|
|
« Reply #2686 on: 16 October 2008, 22:01:12 » |
|
I wrote an entire HTML server without using functions once. It's not hard to, but it's bad practice since it reduces readability. Speaking more about programming, in class today, our teacher gave us another assignment. However, this time, he's letting us work on it during the last hour of class (usually he gives it to us at the end of class).
Anyway, this time the assignment was 100% easier than that damn dice thing. I couldn't believe how much easier it was. It's a program where you have to guess a number between 1 to 100. The only difference was that this time we had to have used a function because we didn't learn about them yet.
Anyway, I started programming it and didn't test it until everything was done. I was surprised to see that the only errors I got was from putting a semi-colon in places where they shouldn't be. And one time where I didn't put in a semi-colon.
So, I was the third one to finish. And at the end of the class only seven people (out of forty-one) finished.
And it executes beautifully. I'll be expecting yet another 100% from that one.
Good job on that. Functions are the bread an butter of basic programming skills. They're technically called "procedures" since they deal with variables, but eh. When you learn to associate them with objects, things get even cooler.
|
|
|
Logged
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Ikeoko
Sniper Joe
Posts: 386
|
|
« Reply #2698 on: 17 October 2008, 13:50:55 » |
|
I'm in school! But it's normal school. Actually....I take that back. It's far from normal. Anyway ya I'm in class and I'm listening to my iTouch and we have like 25 minutes left in here. XP
|
|
|
Logged
|
~ ♥ ~ ANNIE ~ ♥ ~ /l、 ゙(゚、 。 7 l、゙ ~ヽ じしf_, )ノ kitteh!
|
|
|
Chron
Super Robot
Posts: 2790
|
|
« Reply #2699 on: 17 October 2008, 17:17:43 » |
|
It is a nice language, but I prefer anything with curly braces over that mess.
Cave Story?
... mmm. Curly Brace. Who writes the programming that let's you guys program? And how does THAT work?
*opens a new can of worms* WARNING! SCIENCE CONTENT [spoiler] OK, so first of all we have to build a machine capable of accepting/rejecting Turing-level languages. The most common type uses binary input/output and is structured according to the architecture described by John von Neumann. This is one type of computer, and it's generally programmable. In addition, programs and data are stored in the same location. Thus, programs are just data, and data can be "looked at" as a program. The machine's processor contains circuits that can perform basic logical comparisons, arithmetic functions and some basic I/O functions (such as getting input from a keyboard or sending things to RAM or what have you). Generally there is a way to store information in the long term on these machines, and most of them will read from a specific set of permanent data stored in ROM (sometimes a bootstrapping program will also load an operating system). This will set up the machine for use by humans. Once a human can use the computer, they can input machine code to have it perform functions. If machine code is stored on the machine's temporary or permanent memory, it can be recalled and run automatically by the machine as if it was a series of input commands by the user. This is a program. Some programs, especially useful in an environment controlled by an OS, use a complex series of algorithms to read in words typed by a human and translate them into something understandable by the computer. These are complex programs that employ lexical analyzers, parsers and translators to read a specifically defined set of words and convert them into a specifically defined set of machine code. They are called compilers. There are also programs that go the extra step and will execute code immediately after compiling portions of it, and these are called interpreters. When one of these programs exists, someone can then type a program into the machine that can be converted by the compiler/interpreter and then run on the machine. The skill required to write a compiler is fairly great, and typically reserved for Master level courses, but Bachelor level courses generally run through lexical analysis and text parsing, since it is a fundamental tool used to understand computer theory. However, anyone with enough patience can learn the skill on their own, as with anything. [/spoiler] tl;dr Programmers write the programming that lets us program, and it works because the machines are built that way.
|
|
|
Logged
|
|
|
|