[fa.info-mac] INFO-MAC Digest V3 #10

info-mac@uw-beaver (06/18/85)

From: Moderator John Mark Agosta <INFO-MAC-REQUEST@SUMEX-AIM.arpa>


INFO-MAC Digest          Tuesday, 18 Jun 1985      Volume 3 : Issue 10

Today's Topics:
                    Modula from ETH Zuerich available
                        Text files into Multiplan
                            Quitting Maze War
                          Exiting from mazewar
                      re: Blit emulator for the mac
            Re: MacDraw (MacDraft) to TeX or LaTeX conversion
                             NEON examples?


----------------------------------------------------------------------


Date: 15 Jun 85 13:59:26 EST (Sat) From: Steven B. Munson
<sbm@Purdue.ARPA> Subject: othello.shar

     Well, here is my long-awaited opportunity to contribute something
to the net.  My only regret is that it is only a game; when my copy of
Inside Macintosh arrives, I will be able to write more useful programs
in my spare time.  However, I have been working on this 
Othello-playing program off and on for several months to learn how to 
write Macintosh programs, and it has gotten to the point where it is 
actually presentable, so I thought others might like to have it.  
Notice that, although the "Move" menu is not dimmed, none of its 
commands are implemented yet.  I am including both a binhex 4.0 file 
and the SUMacC source, including a makefile (that most important of 
all parts of any source distribution).  Anyone interested in grabbing 
the source code and modifying it might want to get the binhex file 
too, since it contains the BNDL, FREF, and ICN# resources necessary to
make the icon appear on the desktop.  I had to do these on the Mac, 
since the SUMacC rmaker doesn't know how to create them.  The 
signature of this program is "OTLO".  I haven't bothered to register 
it; I hope it isn't used yet.  To compile the source, just type "make 
dl", which will compile everything and download it to your Macintosh, 
ready to run.

     This article is probably a bit long for a game announcement, but
this program contains the extent of my knowledge about the innards of
the Macintosh, and there were a few points I wanted to mention.

User Interface

     One of my primary goals in this program was that the user should
never have to wait for the Mac to say it's OK to go on.  At higher
skill levels (like 4 and beyond), the program may take a long time to
figure out its next move, but this doesn't mean that the user has to
sit there staring at the screen waiting for the next move.  While it
is "thinking", the user can still pull down menus, start up desk
accessories and use them.  This is made possible by my approach to
handling events, which is slightly different from that of the other
programs I have seen source code for (more later about the DoEvent()
function).  Most importantly, there is a command that interrupts the
program's "thinking" process, so the user can regain complete control
at any time.  Quitting while the program is thinking is also possible.

     Another goal was maximum flexibility.  At any time, even while
the Macintosh is thinking about its next move, all the commands can
still be used.  Changing the skill level or players takes effect on
the next move; other changes (including turning tracing on and off)
take effect immediately.

Source Code

     When the skel program came out, I stuck my already-existing
Othello program into it so that I could use menus, so you will see
some similarity with that program.  My big departure from it was to
replace the MainEventLoop function with a DoEvent function, which did
essentially what MainEventLoop did, but just once.  Hence, the main
program contains

        while (TRUE)
                DoEvent();

and I can call DoEvent anywhere I want, to insure that the user never 
loses control.  Since the function that determines the next move is 
recursive, I only had to put in one extra call to DoEvent.  I also put
all the code dealing with menus in a separate file; it just made more
sense to me to do it that way.

     For those of you that learn about the Macintosh by reading source
code, here is a summary of what you can learn from Othello:

Fonts, etc.:
        info.c draws strings in different fonts and styles (bold,
italic,
        plain text) and centers them.

C strings vs. Pascal strings:
        In menu.c, where it handles the "About Othello" command, the
        original version of skel I had used a kludgey way of
converting
        the Pascal string returned from GetString() to a C string that
        didn't work in some cases.  You can see how isapstr() solves
that
        problem there and in info.c.

Graphics:
        drawboard.c draws various lines and ovals.

Further Work

     To those who decide to look at the source code, I would like to
know why the Extras desk accessory (version 1.2) crashes the system
when it closes from within Othello; it's OK as long as I don't close
it.  Other improvements to be done are implementing the "Save Game"
function (I don't know how to do I/O), implementing the commands in
the Move menu (I just haven't had time -- I have in mind that the
undo/redo function will remember the whole history of the game), and
maybe having the program remember the players, skill, and trace values
from one run to the next (by writing into its data fork?).  Notice
that I already have a nice Othello document icon for saved games,
whenever that feature is implemented (I detest invisible files).  If
you make a significant improvement, please let me know.  Not that I
think this is a very important program, but I my be interested in
seeing how it's done.

                                        Steve Munson
                                        sbm@purdue.ARPA
                                        sbm@purdue.CSNET

 [ I have put the shar file in UTILITY-OTHELLO.SHAR and the compiled
   code in UTILITY-OTHELLO.HQX.  This shell archive contains the
   following files:
 AboutOthello drawboard.c initboard.c othello.c
 Makefile findmoves.c menu.c othello.h
 doflips.c getmove.c move.c othello.rc
 domove.c info.c newgame.c placestone.c
 undo.c

 "UTILITY-" has come to mean "useful as a programming example" rather
 than "a progrmming tool" -jma ]

------------------------------

Date: Wed, 5 Jun 85 15:32:36 cdt
From: werner@ut-ngp.ARPA (Werner Uhrig)
Subject: Modula from ETH Zuerich available

From aebi@unizh.UUCP Wed Jun 5 00:08:02 1985 Relay-Version: version B
2.10.1 6/24/83; site ut-ngp.UUCP Posting-Version: version B 2.10.1
6/24/83 (MC840302); site unizh.UUCP Path:
ut-ngp!ut-sally!seismo!mcvax!cernvax!unizh!aebi From: aebi@unizh.UUCP 
Newsgroups: net.micro.mac Subject: Modula-2 compiler: Summary 
Message-ID: <158@unizh.UUCP> Date: Wed, 5-Jun-85 00:08:02 CDT 
Date-Received: Tue, 4-Jun-85 18:31:36 CDT Organization: Inst. fuer
Informatik, Univ. Zuerich, Switzerland Lines: 249

First of all I would like to thank all of you who took the time to
answer my request. Up to now I got about 35 replies. All but one asked
me to post the compiler to the net.  So I finally got the permission
from our sysop to post the stuff. I hope those of you who sent mail
aren't disappointed if I don't answer all the questions individually.
But let me summarize some of the questions and suggestions that could
be of interest to everybody:

- The e-mail address you specified was wrong.

  In the last message I specified my address as follows:
  !{seismo,mcvax,cernvax,unizh}!aebi
  This was wrong. It should have been
  ...seismo!mcvax!cernvax!unizh!aebi

  I apologize for any inconvinience that anybody had because of this
mistake.

- Where can I get a general version of the 68K Modula-2 compiler from
?

  For more information or a source code licence write directly to:

  Michael Moser
  Institut fuer Elektronik
  Gloriastr. 35
  CH-8092 Zuerich
  Switzerland

  This is *not* the Macintosh version. But it is the code the Mac
version is
  based on. (BTW There's a rumor, that Atari will adapt this compiler
for
  their ST. So everybody may get a useful development tool right from
the
  start!)

- How much for a licence of the Macintosh version ?

  At the moment you can't buy the source code as there is nobody at
the
  ETH who has got the time to do the distribution. But I will post
some of
  the modules (e.g. the module that does the trap call, the LisaPascal
  source of the loader) to the net. So you will be able to create your
own
  Toolbox library.

- Can we distribute the compiler to Mac users groups ?

  Feel free to give this compiler to your friends, other networks,
  users groups and so on.

- Could you please repost the PackIt program as missed it.

  As the whole posting is useless if people can't unpack the files, I
will
  redistribute this very useful utility.

- Couldn't you give the compiler to sumex and hope, that copies
trickle to
  non-arpa sites.

  As I don't know how to do this from here, I leave this up to anybody
on the
  net who is able to do so.

- Will the compiler run on 128 kByte Macs ?

  It doesn't seem, as if there was anybody willing to spend the time
to
  shrink the compiler at the ETH. But if any hacker would like to try
it, I
  will give him any support I can.

- You should post the compiler bit by bit.

  That's exactly what I plan to do. The posting consists of 13 files
of a
  size between 31 and 64 kBytes. I will post one of the files every
two or
  three days. So watch out. Don't miss any of them. Given their size
we
  should try to avoid any reposting.

- Mac Modula Users Group

  After thinking about it, I agree with those of you who suggested to
keep
  the exchange of information, programs and modules on the net. As
we'll see
  that this loads the net to much, we still can search for an other
form of
  communication / distribution.

- Yes, I'd like to help the compiler people by writing some modules.

  Many thanks to everybody who is willing to spend some time on this.
  I'll let you know, what could be done, as soon as I get some
specifi-
  cations from the ETH. (You may also just do what you think should be
  done. I'll try to give you as much support as possible)

                               *****

Now let's get to the technical details of the posting:  To keep all
the files of the posting below the 64 kByte limit, I won't add any
comment to the files sent in net.sources.mac.  Instead I will give you
some hints on downloading and placing the files to the different disks
here:

- You need three blank disks. Name them as

  M2-System
  M2-Doc
  MODLIB (the compiler won't work if this disk has an other name)

- Put all the System-Files and an editor (MDS editor, MacWrite ...) on
  the M2-System and M2-Doc disks.

- Download the 'PackIt' program from the net as you will need this to
  unpack the postings of the compiler.

- Load down the files posted to net.sources.mac. Convert them with
binhex
  4.0 / 5.0.

- By now you should have a file with a name like m2-?.pit. Unpack this
file
  using the PackIt program. If everything went ok, there should now be
  several binary files on your disk.

- Copy the files to the disk that is specified in the table below.

File-Name Disk Comment ========= ==== =======

Part 1
------ Exec128 M2-System loader for 128 kByte Macs Exec512 M2-System
loader for 512 kByte Macs PiRandom M2-System sample program *) Hiero
M2-System sample program *)

*) these are executable files generated by the M2 compiler. You may
try
   these little demos at this point (i.e. you don't need any other
files
   to run them)

Part 2
------ CKurve2 M2-System sample program Magic.MOD M2-System sample
source PiRandom.MOD M2-System sample source Hiero.MOD M2-System sample
source CKurve2.MOD M2-System sample source LisaConvert M2-Doc 
Introduction M2-Doc short introduction to the compiler

Part 3
------ GUIDE.TXT M2-Doc Explanation of all the compiler options...

Part 4
------ CLOCK.DEF M2-Doc *.DEF: Definition modules CONVERSIONS.DEF
M2-Doc EVENTMGR.DEF M2-Doc INTERMINAL.DEF M2-Doc LOADER.DEF M2-Doc 
M2FILES.DEF M2-Doc MATHLIB0.DEF M2-Doc MATHLIB1.DEF M2-Doc 
MCLOOKUP.DEF M2-Doc OUTTERMINAL.DEF M2-Doc REALTERMINAL.DEF M2-Doc 
STORAGE.DEF M2-Doc TERMINAL.DEF M2-Doc CLOCK.SYM MODLIB *.SYM: Symbol
files CONVERSIONS.SYM MODLIB EVENTMGR.SYM MODLIB INTERMINAL.SYM MODLIB
LOADER.SYM MODLIB M2FILES.SYM MODLIB MATHLIB0.SYM MODLIB MATHLIB1.SYM
MODLIB MCLOOKUP.SYM MODLIB OUTTERMINAL.SYM MODLIB REALTERMINAL.SYM
MODLIB STORAGE.SYM MODLIB TERMINAL.SYM MODLIB

Part 5
------ OPTIONS.DEF M2-Doc OSCONSTANTS.DEF M2-Doc OUTFILE.DEF M2-Doc 
PASCALSTRINGS.DEF M2-Doc QUICKDRAW.DEF M2-Doc SFPACKAGE.DEF M2-Doc 
OPTIONS.SYM MODLIB OUTFILE.SYM MODLIB PASCALSTRINGS.SYM MODLIB 
QUICKDRAW.SYM MODLIB SFPACKAGE.SYM MODLIB

Part 6
------ m2link MODLIB M2 linker

Part 7
------ CONVERSIONS.LNK MODLIB *.LNK: link files LOADER.LNK MODLIB 
m2comp MODLIB M2 compiler M2FILES.LNK MODLIB REALTERMINAL.LNK MODLIB

Part 8
------ CLOCK.LNK MODLIB EVENTMGR.LNK MODLIB INTERMINAL.LNK MODLIB 
M2ROOTLOOKUP.LNK MODLIB MACBASE.LNK MODLIB MATHLIB0.LNK MODLIB 
MATHLIB1.LNK MODLIB MCLOOKUP.LNK MODLIB MEMORYMGR.LNK MODLIB 
OPTIONS.LNK MODLIB OSTYPES.LNK MODLIB OUTFILE.LNK MODLIB 
OUTTERMINAL.LNK MODLIB PASCALSTRINGS.LNK MODLIB PBFILE.LNK MODLIB 
PSTRINGS.LNK MODLIB QUICKDRAW.LNK MODLIB SFPACKAGE.LNK MODLIB 
STORAGE.LNK MODLIB SYSTEMX.LNK MODLIB TERMINAL.LNK MODLIB

Part 9
------ M2CP4.LOD MODLIB compiler pass 4

Part 10
------- M2CP1.LOD MODLIB compiler pass 1 M2CLIS.LOD MODLIB

Part 11
------- M2CP2.LOD MODLIB compiler pass 2 Compiler.MERR MODLIB

Part 12
------- M2CINI.LOD MODLIB M2CP3.LOD MODLIB

Part 13
------- M2CP5.LOD MODLIB M2CSYM.LOD MODLIB


p-mail: Matthias Aebi e-mail:  ...seismo!mcvax!cernvax!unizh!aebi
        Hirschgartnerweg 25
        CH-8057 Zuerich
        Switzerland

------------------------------

Date: Wed 12 Jun 85 10:56:56-EDT
From: S.A67J-PELKIE-CHRIS%CRNL20A.BITNET@Berkeley
Subject: Text files into Multiplan
Sender: S.YFM-FRESINSKI-LARRY%CRNL20A.BITNET@Berkeley


Short of writing a SYLK file generator (anybody out there
interested?), the easiest way to move data into Multiplan is via
MacWrite and Clipboard (or Scrapbook). Open the Helix text file with
MacWrite, select the appropriate stuff, Copy, optionally paste into
Scrapbook, quit MW, start MP, select top left cell, optional select
whole area to paste into, then Paste.  Don't stop there, you can
rearrange information in Multiplan and select it, carry it over to
Word to create the data for a Print Merge doc. Have fun.  Chris
Pelkie, Technical Consultant, Distributed Computing Services Cornell
University

------------------------------

Date: Tue, 11 Jun 85 09:16 pst
From: "pugh jon%e.mfenet"@LLL-MFE.ARPA
Subject: Quitting Maze War


You can get back to the systme from Maze War by typing a Command-Z, 
roughly equivalent to a control-z, meaning exit on many systems.

I found it by accident, but thought everyone should know.

Jon Pugh

------------------------------

Date: Tue, 11 Jun 85 11:02:43 pdt
From: reif%ucblapis.CC@Berkeley
Subject: Exiting from mazewar

Its not documented in the start-up screen, but COMMAND-Q does
terminate mazewar.  (It does a system-reset, not a ReturnToShell,
though.)  Mazewar appear to run entirely in memory, so you can eject
the disk with SHIFT-COMMAND-1 and startup the next machine down the
line.

My copy has an ABusIDPoker desk accessory.  Is it necessary to give
each mac on the Appletalk a unique id in order to have more than two
mazewar users?

David Oster

------------------------------

Date: 11-Jun-85 16:46:16-PDT
From: sml@FORD-WDL1.ARPA
Subject: re: Blit emulator for the mac

A company called Rammas Vision has a product which claims to provide a
multiple window interface (each an active terminal) from a Mac or
IBM-PC to UNIX, AOS/VS, VMS, and VM.  They claim to emulate either a
vt100 or a Tek 4014.  I expect to see a demo in the near future and
will report to this forum.  For those who can't wait:

        Rammas Vision
        2685 Marine Way
        Shoreline 1325
        Mountain View, CA 94043
        (415) 969-2662

Steve Lazarus (415) 852-4203 Ford Aerospace ...fortune!wdl1!sml
(USENET) MS X-20 sml@ford-wdl1 (ARPA) 3939 Fabian Way Palo Alto, CA
94303

------------------------------

Date: Mon 3 Jun 85 13:33:20-PDT
From: Hans Mulder <m.hans@SU-SIERRA.ARPA>
Subject: Re: MacDraw (MacDraft) to TeX or LaTeX conversion

John Mark,

Thank you for your response.  I actually formulated my request wrong.

I like to have illustrations directly inside my LaTeX input to avoid
glue or pressedit.  Making those (simple) illustrations allways have
been a big pain.  A simple block diagram takes a whole afternoon or
something like that.

My idea is to create those (simple) illustrations by means of MacDraw
and translate them into the LaTeX picture commands 
(makebox,framebox,dashbox,line,vector,circle,oval).  I don't want to
translate an arbitrary picture into LaTeX but only pictures I
otherwise have to make with LaTeX commands.

I assume given your response that this is not done. Maybe I'm trying
something ridiculous and should I just edit in MacDraw images on a
lower level (dvi,press,imp).

I would appreciate a comment on this restated question.  Thanks in
advance.

Hans Mulder

------------------------------

Date: Wed, 12 Jun 85 14:00:55 edt
From: garl@nlm-vax (Gary Letourneau)
Subject: NEON examples?


   Would some kind soul please post sample NEON code to the net? I am 
debating on buying it during its introductory offer. But, before I do 
buy it I would like to get a feel for what the code looks like. I 
understand it is forth-like with a "small-talk" flavor.
   Also, does anyone have benchmarks to demonstate its speed?

                                                Gary Letourneau
                                                garl@nlm-vax

------------------------------

End of INFO-MAC Digest
**********************