<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
@font-face
        {font-family:"Lucida Console";
        panose-1:2 11 6 9 4 5 4 2 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        color:black;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";
        color:black;}
tt
        {mso-style-priority:99;
        font-family:"Courier New";}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:Consolas;
        color:black;}
p.msonormal0, li.msonormal0, div.msonormal0
        {mso-style-name:msonormal;
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        color:black;}
span.EmailStyle21
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;}
span.EmailStyle24
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body bgcolor="white" lang="EN-US" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal">Fascinating, as Mr. Spock would say. ;-)<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I’m not sure where my copy is now, but 101 Basic Computer Games really jump-started my programming, and in my opinion the Star Trek game was the best game in the book. I ended up adapting it to run on my [okay, my Dad’s LOL] TRS-80 (Model
 1, Level II, eventually a whopping 32KB of memory), and of course it wasn’t big enough so it got expanded, adding more features like persistent galaxy state (saved between sessions) and multiplayer capability. (Not simultaneously, of course, but the concept
 of multiple ships of which one was actively in use by the current player.)<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">This abused several interesting features of the TRS-80’s Radio Shack Level II BASIC… One (that I’ve never encountered anywhere else) was that you didn’t have to put spaces in the code, and eliminating each space saved a byte of memory.
 The following was perfectly legal and readable if your eye was practiced:<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span style="font-family:"Courier New"">100 FORI=1TO10<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New"">110 PRINTI<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New"">120 NEXTI<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Now imagine more complex lines. After all, running them all together eliminates unneeded line numbers and saves even more memory:<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span style="font-family:"Courier New"">100 FORI=1TO10:PRINTI:NEXTI<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Then you eliminate all of the comments, because they’re pure overhead… When I still ran out of room, I started converting some functions into machine code (by hand, using a Z80 reference book) and POKEing them into memory…<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Luckily, I went to college and encountered a VAX-11/780, at which point I recoded the whole mess in VAX-11 BASIC, took advantage of the expansive VT100 display real estate, and began abusing (as they became available) indexed files, shared
 global sections, and the lock manager to make real multiplayer gaming workable.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Despite all of that, the heredity of the game is evident, including the coordinate system: (see the compass in the upper right corner!)<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><img width="723" height="385" style="width:7.5333in;height:4.0083in" id="Picture_x0020_1" src="cid:image001.jpg@01D4B4AA.9B972180"><o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">That brings me back around to the point of this note. In VAX BASIC, fundamentally unchanged since some point prior to 1985, my course logic looks like this:<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:12.0pt;font-family:"Lucida Console"">!<span style="background:black;mso-highlight:black"><o:p></o:p></span></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:12.0pt;font-family:"Lucida Console"">! Return a real course from point (x1,y1) to point (x2,y2)<span style="background:black;mso-highlight:black"><o:p></o:p></span></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:12.0pt;font-family:"Lucida Console"">! using Star Trek course notation.<span style="background:black;mso-highlight:black"><o:p></o:p></span></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:12.0pt;font-family:"Lucida Console"">!<span style="background:black;mso-highlight:black"><o:p></o:p></span></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:12.0pt;font-family:"Lucida Console"">        function single course(long x1,y1,x2,y2)<span style="background:black;mso-highlight:black"><o:p></o:p></span></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:12.0pt;font-family:"Lucida Console"">        declare long x,y<span style="background:black;mso-highlight:black"><o:p></o:p></span></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:12.0pt;font-family:"Lucida Console"">        declare single temp<span style="background:black;mso-highlight:black"><o:p></o:p></span></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:12.0pt;font-family:"Lucida Console"">        on error go back<span style="background:black;mso-highlight:black"><o:p></o:p></span></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:12.0pt;font-family:"Lucida Console"">        x = x2-x1                               ! Calculate offset P1 -> P2<span style="background:black;mso-highlight:black"><o:p></o:p></span></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:12.0pt;font-family:"Lucida Console"">        y = y2-y1                               ! Std. Cartesian system<span style="background:black;mso-highlight:black"><o:p></o:p></span></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:12.0pt;font-family:"Lucida Console"">        if x='0'L then<span style="background:black;mso-highlight:black"><o:p></o:p></span></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:12.0pt;font-family:"Lucida Console"">          if y>'0'L then<span style="background:black;mso-highlight:black"><o:p></o:p></span></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:12.0pt;font-family:"Lucida Console"">            course = 3.0                        ! Straight up<span style="background:black;mso-highlight:black"><o:p></o:p></span></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:12.0pt;font-family:"Lucida Console"">            exit function<span style="background:black;mso-highlight:black"><o:p></o:p></span></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:12.0pt;font-family:"Lucida Console"">          else<span style="background:black;mso-highlight:black"><o:p></o:p></span></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:12.0pt;font-family:"Lucida Console"">            course = 7.0                        ! Straight down<span style="background:black;mso-highlight:black"><o:p></o:p></span></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:12.0pt;font-family:"Lucida Console"">            exit function<span style="background:black;mso-highlight:black"><o:p></o:p></span></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:12.0pt;font-family:"Lucida Console"">          end if<span style="background:black;mso-highlight:black"><o:p></o:p></span></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:12.0pt;font-family:"Lucida Console"">        else<span style="background:black;mso-highlight:black"><o:p></o:p></span></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:12.0pt;font-family:"Lucida Console"">          temp = atn(real(y)/real(x))*57.2958   ! Calculate angle in degrees<span style="background:black;mso-highlight:black"><o:p></o:p></span></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:12.0pt;font-family:"Lucida Console"">          if x<='0'L then<span style="background:black;mso-highlight:black"><o:p></o:p></span></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:12.0pt;font-family:"Lucida Console"">            temp = temp+180.0                   ! Correct for quadrant<span style="background:black;mso-highlight:black"><o:p></o:p></span></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:12.0pt;font-family:"Lucida Console"">          else<span style="background:black;mso-highlight:black"><o:p></o:p></span></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:12.0pt;font-family:"Lucida Console"">            if y<'0'L then<span style="background:black;mso-highlight:black"><o:p></o:p></span></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:12.0pt;font-family:"Lucida Console"">              temp = temp+360.0<span style="background:black;mso-highlight:black"><o:p></o:p></span></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:12.0pt;font-family:"Lucida Console"">            end if<span style="background:black;mso-highlight:black"><o:p></o:p></span></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:12.0pt;font-family:"Lucida Console"">          end if<span style="background:black;mso-highlight:black"><o:p></o:p></span></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:12.0pt;font-family:"Lucida Console"">        end if<span style="background:black;mso-highlight:black"><o:p></o:p></span></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:12.0pt;font-family:"Lucida Console"">        course = temp/45.0+1.0                  ! Convert to proper notation<span style="background:black;mso-highlight:black"><o:p></o:p></span></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:12.0pt;font-family:"Lucida Console"">        end function<span style="background:black;mso-highlight:black"><o:p></o:p></span></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">My guess is that this algorithm is more or less what you expected to find before you started digging into the code. (Originally this used bytes, but as memory became cheaper and access more convoluted, I promoted things to improve alignment.)<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">But here’s the punchline: I realized, as I was reading through your excerpt, that the algorithm used by the original game is EXACTLY the same that I used in my head to “estimate” courses when I was playing my game and I didn’t have the
 time to ask the computer for the course before getting shot myself. I don’t remember learning it from the original code, but I’m sure that’s where it came from.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">If I had to guess – and I am – I’d say the original implementation might not have had trig functions available (when did BASIC acquire them?), and this is a pretty decent approximation. At least for the limited size and high granularity
 of a 64-sector quadrant. Certainly I could do it rapidly in my head, and I can testify that the results pretty much always match the “obvious” calculation, if you can aim and shoot fast enough that the target hasn’t moved!<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Those were the days,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Scott<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal" style="margin-left:.5in"><b>From:</b> Simh <<a href="mailto:simh-bounces@trailing-edge.com">simh-bounces@trailing-edge.com</a>>
<b>On Behalf Of </b>Will Senn<br>
<b>Sent:</b> Wednesday, January 23, 2019 10:22 AM<br>
<b>To:</b> Clem Cole <<a href="mailto:clemc@ccc.com">clemc@ccc.com</a>><br>
<b>Cc:</b> Simh <<a href="mailto:simh@trailing-edge.com">simh@trailing-edge.com</a>>; Bryan Davies <<a href="mailto:bryan.e.davies@gmail.com">bryan.e.davies@gmail.com</a>><br>
<b>Subject:</b> Re: [Simh] 101 Basic Games for RSTS/E (was Re: PDP11 on Simh for public access)<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal" style="margin-left:.5in"><o:p> </o:p></p>
<div>
<p class="MsoNormal" style="margin-left:.5in">On 1/21/19 3:55 PM, Clem Cole wrote:<o:p></o:p></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<div>
<div>
<div>
<div>
<div>
<p class="MsoNormal" style="margin-left:.5in"><span style="font-family:"Arial",sans-serif;color:blue">Anyway, the point is that simple computer games in BASIC were being passed around between people (as paper tapes), particularly if you had acccess to multiple
 different brands of computers.    You always had the source code, in those days so it was really not big deal.  In fact, my memory is that one of the new things that you could do on the PDP-10 was >>compile<< your basic program, or at least leave it in some
 form that some one could not see what you had done.   But the HP and GE system, you just loaded the program and typed 'list' - often after turning on the paper tape punch the ASR33.</span><span style="font-family:"Arial",sans-serif"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in"><span style="font-family:"Arial",sans-serif"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in"><span style="font-family:"Arial",sans-serif;color:blue">Clem</span><span style="font-family:"Arial",sans-serif"><o:p></o:p></span></p>
</div>
</div>
</div>
</div>
</div>
</blockquote>
<p style="margin-left:.5in"><span style="font-size:7.5pt;color:white">Wow</span><o:p></o:p></p>
<p style="margin-left:.5in">So, I dug a bit and found the code is practically everywhere  and when folks extended it, they were pretty specific about what they extended. Take the code for the library computer's calculator for distance and direction... it's
 nearly untouched in other versions - prolly cuz it's a little convoluted (seems like some translation from rectangular to polar coordinates and back again using standard trig functions would have worked and been MUCH easier to understand...<o:p></o:p></p>
<p style="margin-left:.5in">In reviewing the SPACWR code, and comparing it to STTR1 which preceded it and SUPERTREK which came later, I came across this bit of library computer code for calculating direction and distance from one sector in a quadrant to another.
 It seems like basic trig would have been easier, but the author chose another route, pun intended. In the code where the direction is calculated, though, it looks like there are at least 2 bugs. But, seeing as all of the versions use basically the same exact
 logic, I must be missing something and I am hoping y'all know something about the interpreter that makes this magically ok, or can read it better than I and tell me that it's actually ok, as is (maybe the bugs don't materially effect the outcome) or this was
 a well known quirk of the system that was beloved by all oldtimers :). <o:p></o:p></p>
<p style="margin-left:.5in">I'm running this in RSTSV06C-03, but STTR1 was written for an HP calculator or something and SUPERTREK was written for a Data General Nova 800 w/32K of core, so I don't think it's a system specific issue, but rather a straight up
 logic problem.<o:p></o:p></p>
<p style="margin-left:.5in">Below is the code and it's pretty self contained.<o:p></o:p></p>
<p style="mso-margin-top-alt:5.0pt;margin-right:0in;margin-bottom:12.0pt;margin-left:.5in">
The 2 bugs are these:<br>
<br>
1. Lines 4880, 5250, and 5270 refer to H8. H8 is effectively constant 0, set in 4880 and again in 5270, the check in 5250 will never evaluate true. It looks like it was meant to break out of the loop early, but there aren't any other uses of it elsewhere in
 the code - but it's persistent - appearing in many versions of the code, doing nothing.<br>
<br>
2. The more pernicious, or at least annoying to me bug is the test in line 5140, X is always less than zero here. So the path from 5140 to 5190 is never executed.<br>
<br>
I don't want to fix anything until I'm sure it's broken. I don't particularly care for the method used here, but if it works...<br>
<br>
Here's what the vector's get translated into (the direction, a real number between 1 and 8.999etc that is calculated), for reference:<br>
<br>
<br>
<tt><span style="font-size:10.0pt"> 4  3  2</span></tt><span style="font-size:10.0pt;font-family:"Courier New""><br>
<tt>  \ ^ /</tt><br>
<tt>   \^/</tt><br>
<tt>5 ----- 1</tt><br>
<tt>   /^\</tt><br>
<tt>  / ^ \</tt><br>
<tt> 6  7  8</tt><br>
</span><br>
This is the code followed by my annotations for what they're worth (usually I put them in column 90, but that wouldn't look good in email, so I just split 'em):<br>
<br>
<tt><span style="font-size:10.0pt">4880 PRINT:H8=0                                                                               
</span></tt><span style="font-size:10.0pt;font-family:"Courier New""><br>
<tt>4881 REM *** PHOTON TORPEDO DATA CODE BEGINS HERE</tt><br>
<tt>4900 FOR I=1TO3                                                                               
</tt><br>
<tt>4910 IF K(I,3)<=0 THEN 5260                                                                   
</tt><br>
<tt>4920 C1=S1:A=S2:W1=K(I,1):X=K(I,2)                                                           
</tt><br>
<tt>4960 GOTO 5010                                                                               
</tt><br>
<tt>4970 PRINT"YOU ARE AT QUADRANT ( "Q1","Q2" )  SECTOR ( "S1","S2" )"                           
</tt><br>
<tt>4990 INPUT "SHIP AND TARGET COORDINATES ARE:";C1,A,W1,X                                       
</tt><br>
<tt>5010 X=X-A:A=C1-W1                                                                           
</tt><br>
<tt>5030 IF X<0 THEN 5130                                                                       
</tt><br>
<tt>5031 IF A<0 THEN 5190                                                                       
</tt><br>
<tt>5050 IF X>0 THEN 5070                                                                       
</tt><br>
<tt>5051 IF A=0 THEN 5150                                                                       
</tt><br>
<tt>5070 C1=1                                                                                   
</tt><br>
<tt>5080 IF ABS(A) <= ABS(X) THEN 5110                                                           
</tt><br>
<tt>5085 V5=C1+(((ABS(A)-ABS(X))+ABS(A))/ABS(A))                                               
</tt><br>
<tt>5090 PRINT "DIRECTION ="V5                                                                   
</tt><br>
<tt>5100 GOTO 5240                                                                               
</tt><br>
<tt>5110 PRINT "DIRECTION ="C1+(ABS(A)/ABS(X))                                                   
</tt><br>
<tt>5120 GOTO 5240                                                                               
</tt><br>
<tt>5130 IF A>0 THEN 5170                                                                       
</tt><br>
<tt>5140 IF X=0 THEN 5190                                                                       
</tt><br>
<tt>5150 C1=5:GOTO 5080                                                                           
</tt><br>
<tt>5170 C1=3:GOTO5200                                                                           
</tt><br>
<tt>5190 C1=7                                                                                   
</tt><br>
<tt>5200 IF ABS(A)>=ABS(X) THEN 5230                                                           
</tt><br>
<tt>5210 PRINT "DIRECTION ="C1+(((ABS(X)-ABS(A))+ABS(X))/ABS(X))                               
</tt><br>
<tt>5220 GOTO 5240                                                                               
</tt><br>
<tt>5230 PRINT "DIRECTION ="C1+(ABS(X)/ABS(A))                                                   
</tt><br>
<tt>5240 PRINT "DISTANCE ="SQR(X**2+A**2)                                                       
</tt><br>
<tt>5250 IF H8=1 THEN 5320                                                                       
</tt><br>
<tt>5260 NEXT I                                                                                   
</tt><br>
<tt>5270 H8=0                                                                                   
</tt><br>
<tt>5280 INPUT "DO YOU WANT TO USE THE CALCULATOR";A$                                           
</tt><br>
<tt>5300 IF A$="YES" THEN 4970                                                                   
</tt><br>
<tt>5310 IF A$<>"NO" THEN 5280                                                                    
</tt><br>
<tt>5320 GOTO 1270                                                                               
</tt><br>
<tt>5321 REM *** END OF LIBRARY COMPUTER CODE</tt><br>
<br>
<tt>! ---- One Scenario that works to help illustrate (direction is 3)</tt><br>
<br>
<tt>! SECTOR MAP (SIMPLIFIED)</tt><br>
<tt>!</tt><br>
<tt>!   | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |</tt><br>
<tt>!    +---+---+---+---+---+---+---+---+</tt><br>
<tt>! 1 |   |   | K1|   |   |   |   |   |</tt><br>
<tt>!    +---+---+---+---+---+---+---+---+</tt><br>
<tt>! 2 |   |   |   |   |   |   |   |   |</tt><br>
<tt>!    +---+---+---+---+---+---+---+---+</tt><br>
<tt>! 3 |   |   |   |   |   |   |   |   |</tt><br>
<tt>!    +---+---+---+---+---+---+---+---+</tt><br>
<tt>! 4 |   |   | E |   |   |   |   |   |</tt><br>
<tt>!    +---+---+---+---+---+---+---+---+</tt><br>
<tt>! 5 |   |   |   |   |   |   |   |   |</tt><br>
<tt>!    +---+---+---+---+---+---+---+---+</tt><br>
<tt>! 6 |   |   |   |   |   |   |   |   |</tt><br>
<tt>!    +---+---+---+---+---+---+---+---+</tt><br>
<tt>! 7 |   |   |   |   |   |   |   |   |</tt><br>
<tt>!    +---+---+---+---+---+---+---+---+</tt><br>
<tt>! 8 |   |   |   |   |   |   |   |   |</tt><br>
<tt>!    +---+---+---+---+---+---+---+---+</tt><br>
<tt>!</tt><br>
<tt>!  S1 = 4, S2 = 3, K(1,1) = 1, K(1,2) = 3</tt><br>
<tt>!  C1 = 4, A = 3, W1 = 1, X = 3</tt><br>
<br>
<tt>4880 ! NO TELLING WHAT H8 IS SUPPOSED TO BE, BUT PRESENT IN STTR1 AND SUPER TREK</tt><br>
<tt>4881 REM</tt><br>
<tt>4900 ! LOOP THROUGH KLINGONS</tt><br>
<tt>4910 ! SKIP ANY THAT ARE DESTROYED</tt><br>
<tt>4920 ! SAVE SECTOR INFORMATION FOR THE ENTERPRISE (4,3) AND KLINGON (1,3)</tt><br>
<tt>4960 ! SKIP THE NEXT TWO LINES</tt><br>
<tt>4970 ! DISPLAY THE LOCATION OF THE ENTERPRISE</tt><br>
<tt>4990 ! DISPLAY THE LOCATION OF THE KLINGON</tt><br>
<tt>5010 ! DETERMINE DISTANCES FROM ENTERPRISE TO KLINGON  (X=0, A=3)</tt><br>
<tt>5030 ! X IS THE I DISTANCE, A IS THE J DISTANCE, X NEGATIVE? (NO)</tt><br>
<tt>5031 ! X IS NON-NEGATIVE, A NEGATIVE? (NO)</tt><br>
<tt>5050 ! A IS NON-NEGATIVE, X > 0? (NO)</tt><br>
<tt>5051 ! X IS ZERO, A ZERO? (NO)</tt><br>
<tt>5070 ! X IS ZERO AND A > 0, SET DIRECTION TO 1 (C1=1)</tt><br>
<br>
<tt>! CORRECT AND PRINT DIRECTION 1 AND 5</tt><br>
<tt>5080 ! J DISTANCE SMALLER THAN OR EQUAL TO THE THE I DISTANCE? JUMP TO 5110 (NO)</tt><br>
<tt>5085 ! V5 = (1 + (((J DISTANCE - I DISTANCE) + J DISTANCE)) / J DISTANCE) | (1+(((3-0)+3))/3) | (3)</tt><br>
<tt>5090 ! DISPLAY THE DIRECTION TO THE USER</tt><br>
<tt>5100 ! GOTO DISPLAY THE DISTANCE</tt><br>
<tt>5110 ! THE J DISTANCE IS SMALLER THAN OR EQUAL TO THE I DISTANCE, DISPLAY (1 + (J DISTANCE/I DISTANCE))</tt><br>
<tt>5120 ! GOTO DISPLAY THE DISTANCE</tt><br>
<br>
<tt>5130 ! X IS NEGATIVE, A > 0?</tt><br>
<tt>5140 ! X IS NEGATIVE, CAN'T BE ZERO..., GONNA FALL THROUGH</tt><br>
<tt>5150 ! X AND A ARE 0 (OR X IS NEGATIVE), SET DIRECTION TO 5, GOTO CORRECT AND PRINT DIRECTION 1 AND 5</tt><br>
<tt>5170 ! X IS NEGATIVE, A > 0, SET DIRECTION TO 3 GOTO PRINT DIRECTION 3</tt><br>
<tt>5190 ! DIRECTION IS 7 ; NOT GONNA HAPPEN</tt><br>
<br>
<tt>! CORRECT AND PRINT DIRECTION 3 AND 7</tt><br>
<tt>5200 ! J DISTANCE GREATER THAN OR EQUAL TO THE I DISTANCE? JUMP TO 5230</tt><br>
<tt>5210 ! DISPLAY THE CORRECTED DIRECTION</tt><br>
<tt>5220 ! GOTO DISPLAY THE DISTANCE</tt><br>
<tt>5230 ! DISPLAY THE UNCORRECTED DIRECTION</tt><br>
<br>
<tt>5240 ! DISPLAY THE DISTANCE</tt><br>
<tt>5250 ! NEVER GONNA HAPPEN</tt><br>
<tt>5260 ! NEXT KLINGON</tt><br>
<tt>5270 ! WHO CARES</tt><br>
<br>
<tt>5280 ! DISPLAY CALCULATOR PROMPT</tt><br>
<tt>5300 ! REDISPLAY YOU ARE AT QUADRANT...</tt><br>
<tt>5310 ! REDISPLAY DO YOU WANT TO USE...</tt><br>
<tt>5320 ! GOTO TOP OF LOOP</tt><br>
<tt>5321 REM</tt></span><o:p></o:p></p>
<p style="margin-left:.5in"><o:p> </o:p></p>
<pre style="margin-left:.5in">-- <o:p></o:p></pre>
<pre style="margin-left:.5in">GPG Fingerprint: 68F4 B3BD 1730 555A 4462  7D45 3EAA 5B6D A982 BAAF<o:p></o:p></pre>
</div>
<br>
DXC Technology Company - Headquarters: 1775 Tysons Boulevard, Tysons, Virginia 22102, USA.
<br>
DXC Technology Company -- This message is transmitted to you by or on behalf of DXC Technology Company or one of its affiliates. It is intended exclusively for the addressee. The substance of this message, along with any attachments, may contain proprietary,
 confidential or privileged information or information that is otherwise legally exempt from disclosure. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient of this message, you are not authorized to
 read, print, retain, copy or disseminate any part of this message. If you have received this message in error, please destroy and delete all copies and notify the sender by return e-mail. Regardless of content, this e-mail shall not operate to bind DXC Technology
 Company or any of its affiliates to any order or other contract unless pursuant to explicit written agreement or government initiative expressly permitting the use of e-mail for such purpose. --.
</body>
</html>