Author Topic: Streaming Method (Celtic III)  (Read 4588 times)

0 Members and 1 Guest are viewing this topic.

Offline Eeems

  • Mr. Dictator
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6266
  • Rating: +318/-36
  • little oof
    • View Profile
    • Eeems
Streaming Method (Celtic III)
« on: July 18, 2009, 10:01:59 pm »
so the basics behind streaming is to take one line at a time from a program and run it. streaming is good for keeping a lot of ram free, because you don't need the whole program on it. what it gains in RAM saving it loses in speed though...due to it having to take from the archive and copy into the ram every line a major speed lose is created.
so to stream a piece of code you need to know how many lines there are in the code, so you can either install a simple check in the code to only run the line if it exists and if it doesn't to end. or you can add a check at the start of the code too see how many lines there are.
Code: [Select]
det(0,"ZZ",5 //create the program ZZ
det(5,"rowswap("+Str1,1  //copy the first line from the appvar named in Str1
det(6,"ZZ",Ans,1  //copy the first line into program ZZ
prgmZZ  //run program ZZ to get the answer in the first line
Ans->U  //store the amount of lines to run to the real U
det(0,"ZZ",4  //delete the program ZZ
For(V,1,U)  //loop for the amount of lines specified in the first line of the appvar
det(0,"ZZ",5  //create the program ZZ
det(5,"rowswap("+Str1,V+1  //get the line specified in the real V
det(6,"ZZ",Ans,1  //store the line to program ZZ
prgmZZ  //run the program ZZ to execute the code we just grabbed
det(0,"ZZ",4  //delete the program ZZ
End  //end the loop
now I know I could have used the errorhandle function to save time in the running, but then programmers could not troubleshoot while using this, and I can't seem to get it to work all the time....
/e

Offline Iambian

  • Coder Of Tomorrow
  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 739
  • Rating: +216/-3
  • Cherry Flavoured Nommer of Fishies
    • View Profile
Re: Streaming Method (Celtic III)
« Reply #1 on: July 18, 2009, 10:33:47 pm »
Quick note: The errorhandle function doesn't like to work for some odd reason. It's a bug that I've mentioned briefly on the UTI forums.
A Cherry-Flavored Iambian draws near... what do you do? ...

Offline Eeems

  • Mr. Dictator
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6266
  • Rating: +318/-36
  • little oof
    • View Profile
    • Eeems
Re: Streaming Method (Celtic III)
« Reply #2 on: July 18, 2009, 10:36:28 pm »
yeah I know, that is why I don't use it...every once in a while it will work, but afterwords it wont
EDIT: here is a version that will use the indexing to it's full advatage
Code: [Select]
det(0,"ZZ",5 //create the program ZZ
det(23,"rowswap("+Str1,Ans  //create index
det(24,"rowswap("+Str1,Str1,1  //copy the first line from the appvar named in Str1
det(6,"ZZ",Ans,1  //copy the first line into program ZZ
prgmZZ  //run program ZZ to get the answer in the first line
Ans->U  //store the amount of lines to run to the real U
det(0,"ZZ",4  //delete the program ZZ
For(V,1,U)  //loop for the amount of lines specified in the first line of the appvar
det(0,"ZZ",5  //create the program ZZ
det(5,"rowswap("+Str1,Str1,V+1  //get the line specified in the real V
det(6,"ZZ",Ans,1  //store the line to program ZZ
prgmZZ  //run the program ZZ to execute the code we just grabbed
det(0,"ZZ",4  //delete the program ZZ
End  //end the loop
det(0,Str1,4  //delete the index
oh yeah and before I forget, I'm going to upload a version of celtic that will make this possible (the other ones have an error catch in the code)
also this version has fixed det(27
this version is complements of snjwffl.. I mean simplethinker

You got my messed up name wrong- simplethinker (aka snjwffl)
« Last Edit: July 18, 2009, 11:33:05 pm by simplethinker »
/e

Offline simplethinker

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 695
  • Rating: +16/-5
  • snjwffl
    • View Profile
Re: Streaming Method (Celtic III)
« Reply #3 on: July 18, 2009, 11:35:40 pm »
Do you need to delete the program every time?  Couldn't you just overwrite the line? (or is this just until LOOKUPINDEX strips newlines?)
"We've all heard that a million monkeys banging on a million typewriters will eventually reproduce the entire works of Shakespeare. Now, thanks to the Internet, we know this is not true." -- Professor Robert Silensky



Chip's Challenge: ħ%

Offline Eeems

  • Mr. Dictator
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6266
  • Rating: +318/-36
  • little oof
    • View Profile
    • Eeems
Re: Streaming Method (Celtic III)
« Reply #4 on: July 19, 2009, 05:58:02 pm »
well I could just replace it, but or some reason it doesn't always work for me, and I could add in the sub(Ans,2,length(Ans)-1 to it to strip teh newlines.
/e

Offline Geekboy1011

  • The Oneironaut
  • Donator
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2031
  • Rating: +119/-2
  • Dream that Awakening dream
    • View Profile
Re: Streaming Method (Celtic III)
« Reply #5 on: July 20, 2009, 12:04:29 pm »
hmm i might actually be able to use this for crimson and the sceenies look great definetily have to figure out how this works :)

Offline Eeems

  • Mr. Dictator
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6266
  • Rating: +318/-36
  • little oof
    • View Profile
    • Eeems
Re: Streaming Method (Celtic III)
« Reply #6 on: July 20, 2009, 06:23:34 pm »
lol, thanks. If you want I can make an engine for you to use, it will just take a little modification of what is above to make work. I'll make full documentation and everything
/e

Offline Geekboy1011

  • The Oneironaut
  • Donator
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2031
  • Rating: +119/-2
  • Dream that Awakening dream
    • View Profile
Re: Streaming Method (Celtic III)
« Reply #7 on: July 20, 2009, 06:25:19 pm »
hmm i might ask that i need to finish a few things fist so ill let u know :)

Offline Eeems

  • Mr. Dictator
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6266
  • Rating: +318/-36
  • little oof
    • View Profile
    • Eeems
Re: Streaming Method (Celtic III)
« Reply #8 on: July 20, 2009, 06:38:45 pm »
kk, no problem
I've already got it mostly built because I will be using something almost the same for my game
/e