This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Messages - miotatsu
Pages: 1 ... 6 7 [8] 9 10 ... 22
106
« on: June 07, 2010, 02:42:04 pm »
no idea, but if they still sell them they should be relatively cheap I have been looking into info on the microprocessor, i have not found much information besides that it is probably a SST39VF1681 (which is a 6502 clone?) and if my information is correct a 6502 runs at 1 to 2 MHz.
108
« on: June 06, 2010, 08:45:49 pm »
as of yesterday piworld pc is back in development  however i will be going on vacation for a few days on Wednesday so there will be a small break in development then.
109
« on: June 03, 2010, 08:11:57 pm »
personally i love to stare at myself in the mirror, no idea why but i always have. I guess I just know a handsome guy when i see one! ;O
110
« on: May 31, 2010, 12:33:35 am »
they are required, it will throw errors without them for me
111
« on: May 30, 2010, 11:34:36 pm »
I was using spasm, the include file that came with the recently released zip with tutorials 1-12 apparently likes bcall(_stuff) :p
112
« on: May 22, 2010, 07:49:10 pm »
9 days left for me, then it will be right back to piworld pc development
113
« on: May 12, 2010, 01:47:14 am »
exactly^ however there is one benefit to it besides just for fun/jokes: it is very simple and very small, i would say it is even easier than ti-basic, which makes it a good language for anyone starting out with programming imo
114
« on: May 11, 2010, 07:21:29 pm »
its programming but for lolcats.
115
« on: May 11, 2010, 06:24:57 pm »
part II is out! Okay so how do we make anything useful with it?
Welcome to Part II of the lolcode tutorial: making something almost sort of useful
Lets make a small example program, how about a program that calculates the amount of xp needed for any given level in the game Volund?
The first thing you will need when making a mathematical program is the formula or equation that the problem uses. In this case we are lucky, people have already figured out what the equation for calculating xp in volund is, it is as follows:
xp = ((((level*(level+1))/2)*10)+600)
that sure is a mouthful isn't it? so lets start off by making a simple Input/Output system. What do we need to start? We need variables. to be exact we need two variables, one for xp and one for level. The user will input the level and it will output the xp. okay now lets start coding!
OBTW DIS PROGRAM CALCULATEZ TEH XP UP TO AT LEAST LVL 100 LOLOLO DIS CODEZ IZ PROPERTIEZ OF TEH ELITE MIOTATSUZ TLDR HAI 1.2 I HAS A XP I HAS A LVL
Woah woah woah, whats that stuff in the beginning? don't worry, its just a comment. OBTW declares the start of a comment, anything inside it is ignored by the interpretter or compiler, it does nothing. so why put it there? because commenting code can help you keep track of things, leave notes, explain what a program does, etc. It is mainly for personal reference. okay so we started a comment but how does it know when the comment is done? with TLDR anything between OBTW and TLDR is a comment. there is more than one way to comment however! you can start an OBTW only on an empty line OR after a line with code on it if there is a comma, such as:
I HAS A VAR ITZ 12, OBTW this is a long comment block see, i have more comments here and here TLDR, I HAS A FISH ITZ BOB
as you can see the same applies to TLDR but before the next line of code.
There is even more to it than OBTW/TLDR though! welcome to the wonderous world of single line comments.
examples:
I HAS A VAR ITZ 12 BTW VAR = 12 I HAS A VAR ITZ 12,BTW VAR = 12 I HAS A VAR ITZ 12 BTW VAR = 12
as you can see you can do the same thing with just BTW but keep in mind that it can only be one line long and at the end. You can use it by setting it off by a space, comma, or new line. Next up is the start of the program, we enter the program at HAI 1.2 and then we declare to variables, XP and LVL
next up we want to ask the user to input a level:
VISIBLE "Lvl:: "! GIMMEH LVL
this shouldn't be anything new, its just VISIBLE and GIMMEH and now we are ready for the real magic:
XP R SUM OF LVL AN 1 XP R PRODUKT OF XP AN LVL XP R QUOSHUNT OF XP AN 2 XP R PRODUKT OF XP AN 10 XP R SUM OF XP AN 600
Wait what? this is wheer we calculate the Xp, remember that formula i posted up there? ((((level*(level+1))/2)*10)+600) yeah that. Lolcode has a rather annoying way of doing math, but it works. You should not use conventional math strategies if you want to stay 1.2 compliant, stick to what is given in the spec:
SUM OF <x> AN <y> BTW + DIFF OF <x> AN <y> BTW - PRODUKT OF <x> AN <y> BTW * QUOSHUNT OF <x> AN <y> BTW / MOD OF <x> AN <y> BTW modulo BIGGR OF <x> AN <y> BTW max SMALLR OF <x> AN <y> BTW min
you can find other useful things in the spec such as boolean operations, i will just cover these however. in order to make this work we will work from the inner most parenthesis outward, following algebraic order. the inner most set of parenthesis are: (level+1) so that is what we will do, this will be stored into XP as a temporary result:
XP R SUM OF LVL AN 1 next we have: (level*(level+1)) which is now (level*(XP)) or simply XP R PRODUKT OF XP AN LVL note that yet again we are storing to XP with R next up we divide the result by two, which i'm sure you can see will be: XP R QUOSHUNT OF XP AN 2 finally we finish it off by multiplying it by 10 and adding 600. XP R PRODUKT OF XP AN 10 XP R SUM OF XP AN 600
so thats how we do math. exciting, i know. now we just display it and end the program VISIBLE "XP:: " XP KTHXBYE this isn't very useful though is it? we can only do one calculation every time we run it! so lets make it loop, or that is to say. once the program is finished lets make it jump back to the start of the program instead of exit. how would we do that? check out what the spec has to say about loops.
IM IN YR <label> <operation> YR <variable> [TIL|WILE <expression>] <code block> IM OUTTA YR <label>
Okay so what does this say? we can use IM IN YR <label> to loop and stuff. what about all that other stuff? the operation variable combo gives it something to test and TIL and WILE for testing and what not but I won't cover that just yet, we just want it to jump back to the top no matter what as long as the program is done lets make a label called BASE, whenever it hits IM OUTTA YR BASE it will jump back to IM IN YR BASE but keep in mind that where you place these commands is very, VERY important. take a look:
OBTW DIS PROGRAM CALCULATEZ TEH XP UP TO AT LEAST LVL 100 LOLOLO DIS CODEZ IZ PROPERTIEZ OF TEH ELITE MIOTATSUZ TLDR HAI 1.2 IM IN YR BASE I HAS A XP I HAS A LVL VISIBLE "Lvl:: "! GIMMEH LVL XP R SUM OF LVL AN 1 XP R PRODUKT OF XP AN LVL XP R QUOSHUNT OF XP AN 2 XP R PRODUKT OF XP AN 10 XP R SUM OF XP AN 600 VISIBLE "XP:: " XP IM OUTTA YR BASE KTHXBYE note that the loop (label) is placed at the very beginning of the program and the ending label (goto) is placed at the end right before the KTHXBYE, this means that the program will never end, you have to hit the X to close it.
next tutorial i will cover more advanced uses of looping.
116
« on: May 11, 2010, 06:02:52 pm »
followed him on twitter :{D
117
« on: May 10, 2010, 07:50:11 pm »
increased the adder size to a nibble and finished the i/o stuffs i will post the source in a sec if anyone wants to see  next i will be changing it into an adder/subtractor Edit: heres the source :ClrHome :1->O :Lbl 1 :Delvar MDelvar L131->dim(L1 :1->P :1->I :28->L :For(N,0,1 :While L>M :Repeat A :getkey->B :(B=92)+(B=102->A :(B=92->L1(P+L-7 :End :Output(O,I,Ans :I+1->I :L-7->L :End :29->L :M+1->M :Output(O,I,"+ :I+1->I :End :Output(O,I-1,"= :For(N,0,3 :L1(P) xor L1(P+1->L1(P+3 :Ans xor L1(P+2->L1(P+6 :L1(P+2) and L1(P+3->L1(P+4 :L1(P) and L1(P+1->L1(P+5 :Ans or L1(P+4->L1(P+9 :P+7->P :End :28->L :For(I,11,14 :Output(O,I,L1(L :L-7->L :End :O+1->O :Goto 1 also to be clear, that delvar line is :Delvar M :Delvar L1 :31->dim(L1 not :Delvar M :Delvar L :131->dim(L1
118
« on: May 10, 2010, 07:39:44 pm »
right now this project as well as piworld have been put on hold until June, however i have not forgotten about it! I have been thinking that when i get back into it i will start with a full implementation of ti-basic and then maybe xlib/celticIII as well, after that is finished i would like to expand it with the ideas that i originally had in mind for this project, such as support for custom screen size, color, sound, etc.
119
« on: May 08, 2010, 10:51:04 am »
okay i found some small errors and tweaked a few things internally and now it works, i am going to change the input and output methods and then i will post the working source in case anyone is interested also if you are wondering why i was working on a full adder in ti-basic, its because i am planning a little virtual-calculator-on-a-calculator I started with a flip-flop and then a 1-bit full adder, now the 3-bit full adder, my next plan is to increase the size of this full adder to probably 1 byte, and then i will make it into a signed adder/subtractor
120
« on: May 08, 2010, 12:47:33 am »
ah, i see now. I think that is why the output is wrong too then, it looks like it is right but just messed up because of that ordering, i will switch that quick and see if it gives the output i originally expected heh
Pages: 1 ... 6 7 [8] 9 10 ... 22
|