🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.modula2
Article #1242

CASE structures

#1242
From: Pat Terry
Date: Sat, 13 Oct 1990 04:56
32 lines
1434 bytes
In Message-ID: <39707@eerie.acsu.Buffalo.EDU> Brian McNamara writes

 >I am using the latest FST compiler. I was attempting to write a program 
...
 >ocurence sampling tables from a text book. What I ended up with was a case
 >construct with 26 possibilities but the range f possibilities was from
 >1 to 10000. After ten minutes the compiler had not completed the second 

Yes, Roger admitted to me once that it is very poor in that particular area.

 >Can anyone tell me where to look for a possible solution?

IF a = 1 THEN one
  ELSIF a = 34 THEN two
  ELSIF a = 98 THEN three
  .....
  ELSIF a = 26 THEN twentysix?

may be clumsy.  If you arrange in a clever order matching on probability
of occurrence it won't be too bad.

Or devise a hashing function or mapping function of your own?
 
 




--  
uucp: uunet!m2xenix!puddle!5!494!4.101!Pat.Terry
Internet: Pat.Terry@p101.f4.n494.z5.fidonet.org
Technical Details
Message-ID: <344.2716D868@puddle.fidonet.org>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rutgers!usc!samsung!uunet!zephyr.ens.tek.com!tektronix!nosun!qiclab!m2xenix!puddle!p101.f4.n494.z5.fidonet.org!Pat.Terry

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rutgers!usc!samsung!uunet!zephyr.ens.tek.com!tektronix!nosun!qiclab!m2xenix!puddle!p101.f4.n494.z5.fidonet.org!Pat.Terry
From: Pat.Terry@p101.f4.n494.z5.fidonet.org (Pat Terry)
Newsgroups: comp.lang.modula2
Subject: CASE structures
Message-ID: <344.2716D868@puddle.fidonet.org>
Date: 13 Oct 90 04:56:16 GMT
Sender: ufgate@puddle.fidonet.org (newsout1.26)
Organization: FidoNet node 5:494/4.101 - Settler City Fido, Grahamstown RSA
Lines: 32