Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Here's the challenge (1st post edited)
#11
Yeah multitasking isn't behind the mountains anymore.
Hardest part is in my opinion to get variable system working, and to read data from the file(I mean to make interpreter to "understand" what is in the file that is)

Am I only competitor so far? Cry Come on people :wink: I know you can do better than this. Bytheway Jatos agreed to be referee for this challange :king: :bounce:
IVA LA QBASIC
Reply
#12
How have you implemented variables? I've found that the best way is having a dynamic array which associates identificators to values, visibilty and scope, and perform sorted insertions. You know, variables are created once and used many times, so it is better to spend more time creating them (sorted insertion) and less looking for them in your structure (a binary search is uber fast in this case).
SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
Reply
#13
Hya, yeah I have already implemented variables(string and integer type) and yeah I use dynamic array.

Also Multitask works and Print, let, locate and color work already. I'm moving to For...Next now.

What you mean by binary search(sorry I'm not very good at english sometimes... :oops: )
IVA LA QBASIC
Reply
#14
Binary search performs a search in a sorted set of objects. It does it taking the object in the middle and comparing it to the searched one. If it is less, you know you have to search in the right half ('cause the set is ordered). If it is greater, you have to search in the left half. So you select whether the left or right half and repeat.

That guarantees that you'll find your object in less than log N tries (log in base 2), which means that, for example, in a set of 256 objects you'll find anything in 8 tries or less.

btw... they way I was thinking about 1st gets the parser working and then you can multitask whatever you want, it's only a matter of shifting which file you are using and performing some protection in variables (visibility)... Thats brings the impossed limit of 255 files as it is the max # of files QB can keep open in theory.
SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
Reply
#15
Sorry na_th_an I'm not following your logic... I have to think about it... maybe tomorrow.

If I let 255 scripts run atthe same time ... it'l get Really slowly. I wan simple count with 4 files... that's enought I guess.

I know there are way's to mae it a lot faster, but I'm trying to make as much as possible script lang to be like qb.
IVA LA QBASIC
Reply
#16
I don't think it's fast, I just think that it is the same to run 4 scripts and to run 32490832 scripts. 255 is the limit QB imposes.

You are reading a line at a time, and parsing/interpreting it. What you have to do is have a loop and read the lines from the several files being ran. Read from file 1, run, read from file 2, run, read for file 3, run ...
SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
Reply
#17
Quote: 255 is the limit QB imposes.

I don't think so. You can have more than 255 files too. All you have to do is store in a cariable reading position and close file, later opening it again you just set reading position with seek to right place :king:
IVA LA QBASIC
Reply
#18
I do believe the 255 is the physical limit. So even with a variable system like this (which I had thought of as well), you've still got the physical limit and there's simply no way around it, so you're going to have to come up with spme kind of system to cycle file handles.
I'd knock on wood, but my desk is particle board.
Reply
#19
Hya all,

okay here's my first preview of my script engine.
statament it has:
Dim, Print, For...Next, Cls, Let, Locate, Begin and end.
Synax should be much like qb, except that variables must be declared in the header before begin statament with dim.

Please try to experiment with the code and tell me what you think :wink:

to run costom script file: Script.exe filename
Okay thats should be enough for now...

http://www.zone.ee/avk/Script%20Engine.rar

Btw... sorry site is in estonian... just wait a few seconds as the window opens.
IVA LA QBASIC
Reply
#20
Hi QBGuru

Why the hell didn't you tell me you were working on it... Grrr
Well it looks nice.... as it is challenge I'll just have to "steal" your code and win :rotfl: anyway see you
url]http://fbide.sourceforge.net/[/url]
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)