Petit Computer Wiki
Advertisement

Ok. Today on SimpleC tutorials, I'll teach you input and advanced output. Yay! Ok, first, input. Lets say I wanted to input a string. Here's what I'd do:

IN> STR[X]

Make sure that space is there! IN> represents input. STR represents a string. X represents the slot. Lemme explain slots. With strings and variables, they are stored in an array-like fashion with more than 250 slots in each (in the interpreter, it's stored in 2 arrays, STRING$ and VARIABLE), so we have to define which slot. No, X is not a variable in this case. It is a constant. Now, you might ask, "Whaaaaa??? How does it get a number from that?" Well, the interpreter actually gets the ASCII value from the character. The ASCII value for a capital X is 88. A lowercase x is 120. This allows for a lot more storage. Because of this, we can store in ANY character. I can even do:

IN> STR[]

Wowzers! What about a variable?

IN> VAR[g]

☺ Easy! That allows the user to input a variable and stores it in variable slot 103.

Ok, now we know how to input. What about output? We know that doing

OUT<"Text here"

will print text on the screen. So how about printing stored strings and variables? Here's what I'll do for a string in slot F:

OUT<STR[F]

And I'm sure you can guess what a variable is:

OUT<VAR[F]

Now we can make a program asking for your name and age, and repeat it back to you! N is for "name" and A is for "age"

OUT<"Hello! What's your name?\n"
IN> STR[N]
OUT<"How old are you?\n"
IN> VAR[A]
OUT<"So your name is "
OUT<STR[N]
OUT"\n"
OUT<"and you are "
OUT<VAR[A]
OUT<" years old. Cool!"

That's it for today! Tomorrow: math! Wednesday: WHEN...DO[...ELSE] statements! (Probably the hardest command in SimpleC)


Ok. Progress on Minecraft DS Beta 1.7. I have fixed 2 of 3 major bugs to fix, and added screenshot takeablity. Only 1 more major bug to fix (been there since Alpha 1.4) and then I can focus on...drumroll...SLIMES!!!


Finally for today's blog post, Minecraft DS Beta 2.0. It's coming, and fast. I've made a poll for the 3 people to test it out. Each person can vote, and the top 3 people voted for get to test it out during its development stage, before it's released as Minecraft DS Final. Current standings:

Leviceljir - 4 votes

Randomouscrap98 - 1 vote

No one has voted for a third person!


That's it for today's blog post!

Advertisement