MUD-Dev
mailing list archive

[ Other Periods  | Other mailing lists  | Search  ]

Date:  [ Previous  | Next  ]      Thread:  [ Previous  | Next  ]      Index:  [ Author  | Date  | Thread  ]

Re: [MUD-Dev] Rooms, 3D arrays, etc.



In <338C39B2.41C67EA6#iname,com>, on 05/28/97 
   at 09:00 AM, Shawn Halpenny <malachai#iname,com> said:

>I wonder at using some sort of RLE, since if you compressed the
>entire array, wouldn't you have to uncompress the first n elements in
>order to address some element deep into the array?

Nope.  Consider how RLE works.  You can read from teh start of the
conpressed region, extracting the extent of each repetition, summing
them, and thereby locating the exact location a specified element
falls in the compressed string.

eg The RLE string runs:

  Format:
    (flag)(character)(count)     
    0 -- the repetition flag

  (0) (x) (20) (0) (y) (5) (A) (B) (C) (0) (z) (8) (D) (E) (0) (q)
(3)...

Whats the value of array[40]?

Just walk the string summing the repetitions etc, and you'll see its a
'q' -- no literal decompression required.

-- 
J C Lawrence                           Internet: claw#null,net
(Contractor)                           Internet: coder#ibm,net
---------------(*)               Internet: clawrenc#cup,hp.com
...Honorary Member Clan McFUD -- Teamer's Avenging Monolith...




[ Other Periods  | Other mailing lists  | Search  ]