(unknown charset) Re: [BLACKBOX] ARRAY as CONSTANT

From: (unknown charset) Oleg N. Cher <"Oleg>
Date: Mon, 11 Feb 2008 20:33:48 +0200

----boundary-LibPST-iamunique-314326312_-_-
Content-type: text/plain

Dear Chris Burrows,

thank you for your answer.

I write very small game in Oberon, Boulder Dash called.
I hope, resulting game will be highly crossplatform
(MS-DOS, Win32, Linux, Java, .NET) and I'll open the source,
and beginners will can study this source and write games
in Oberon and BlackBox.

Under MS-DOS I use Oberon-M compiler by E. R. Videki.
Under Win32 I choose BlackBox compiler because it can
generates small independent executables (from 4 kb).
Btw, I heard that some people has ELF linker for BlackBox.
(it's for generating ELF executables for 80386 Linux).
Please see:
http://www.mathstat.helsinki.fi/openbugs/Manuals/Developer/Tools.html

It's additional bonus for BlackBox as a compiler for game.

>AFAIK, Wirth has never incorporated this feature in the design of any of his
>languages (including Pascal, and Modula-2). It wasn't that he didn't
>consider it - I can perhaps look up some references if you are interested in
>the reasoning behind his decisions.

No, thanks :-) We have that we have.
But if we will find good reason for including CONSTANT ARRAYS
in Component Pascal and BlackBox, it will be fine!
>
>With large arrays it also becomes a maintenance nightmare if you wrote it
>the Delphi way. as you soon lose track of which element has which value:
>
>CONST
> a: ARRAY [0..10000] OF INTEGER = (27, 63, 0, 42, 1176, 2, 23, (* 9991
>more values *), 342, 678, 175);

Often this is not very much important, to know which element has what value.
Interests us only, that we achieve all elements by surplus of index.

>Of course, if the sequence of values followed the simple pattern in your
>original example it would easily be coded as:
>
>FOR i := 0 TO LEN(a) - 1 DO a[i] := i + 1 END;

No this method does not useable at this time.

>There would be some runtime overhead (a few milliseconds perhaps) but
>nothing to worry about. If, alternatively, the data was compiled into the
>exe you would have to account for the time to read from the disk and load
>into memory anyway. My guess is that would be slower.

Chris, may be is there method to open array from resource,
that linked to executable?

>How many elements do you have?

Approximately, 10 000

>Is there any pattern to the sequence of elements?

No. Big arrays in the game that are font, sprites and levels.

>If so, if you can devise an algorithm that clearly exposes the pattern
>(as above) that will make the code easier to understand, verify and maintain.
>If it is a large number of disjoint values can you read them in from a file?

Yep, we can put data into file, and open the file in run-time.
But I would like that game will be as one executable file.
And theoretically interested in new knowledge and excellent solutions :-)


Oleg N. Cher,
Colossoft Research.
allot{([at]})nowhere.xy
2008-02-11


----
To unsubscribe, send a message with body "SIGNOFF BLACKBOX" to LISTSERV{([at]})nowhere.xy----boundary-LibPST-iamunique-314326312_-_-
Content-type: application/rtf
Content-transfer-encoding: base64
Content-Disposition: attachment; filename="rtf-body.rtf"
e1xydGYxXGFuc2lcYW5zaWNwZzEyNTFcZnJvbXRleHQgXGRlZmYwe1xmb250dGJsDQp7XGYwXGZz
d2lzcyBBcmlhbDt9DQp7XGYxXGZtb2Rlcm4gQ291cmllciBOZXc7fQ0Ke1xmMlxmbmlsXGZjaGFy
c2V0MiBTeW1ib2w7fQ0Ke1xmM1xmbW9kZXJuXGZjaGFyc2V0MCBDb3VyaWVyIE5ldzt9fQ0Ke1xj
b2xvcnRibFxyZWQwXGdyZWVuMFxibHVlMDtccmVkMFxncmVlbjBcYmx1ZTI1NTt9DQpcdWMxXHBh
cmRccGxhaW5cZGVmdGFiMzYwIFxmMFxmczIwIERlYXIgQ2hyaXMgQnVycm93cyxccGFyDQpccGFy
DQp0aGFuayB5b3UgZm9yIHlvdXIgYW5zd2VyLlxwYXINClxwYXINCkkgd3JpdGUgdmVyeSBzbWFs
bCBnYW1lIGluIE9iZXJvbiwgQm91bGRlciBEYXNoIGNhbGxlZC5ccGFyDQpJIGhvcGUsIHJlc3Vs
dGluZyBnYW1lIHdpbGwgYmUgaGlnaGx5IGNyb3NzcGxhdGZvcm1ccGFyDQooTVMtRE9TLCBXaW4z
MiwgTGludXgsIEphdmEsIC5ORVQpIGFuZCBJJ2xsIG9wZW4gdGhlIHNvdXJjZSxccGFyDQphbmQg
YmVnaW5uZXJzIHdpbGwgY2FuIHN0dWR5IHRoaXMgc291cmNlIGFuZCB3cml0ZSBnYW1lc1xwYXIN
CmluIE9iZXJvbiBh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