1.\" $OpenBSD: atc.6,v 1.23 2016/03/07 12:07:55 mestre Exp $ 2.\" 3.\" Copyright (c) 1990, 1993 4.\" The Regents of the University of California. All rights reserved. 5.\" 6.\" This code is derived from software contributed to Berkeley by 7.\" Ed James. 8.\" 9.\" Redistribution and use in source and binary forms, with or without 10.\" modification, are permitted provided that the following conditions 11.\" are met: 12.\" 1. Redistributions of source code must retain the above copyright 13.\" notice, this list of conditions and the following disclaimer. 14.\" 2. Redistributions in binary form must reproduce the above copyright 15.\" notice, this list of conditions and the following disclaimer in the 16.\" documentation and/or other materials provided with the distribution. 17.\" 3. Neither the name of the University nor the names of its contributors 18.\" may be used to endorse or promote products derived from this software 19.\" without specific prior written permission. 20.\" 21.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 22.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 23.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 24.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 25.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 26.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31.\" SUCH DAMAGE. 32.\" 33.\" @(#)atc.6 8.1 (Berkeley) 5/31/93 34.\" 35.\" Copyright (c) 1986 Ed James. All rights reserved. 36.\" 37.Dd $Mdocdate: March 7 2016 $ 38.Dt ATC 6 39.Os 40.Sh NAME 41.Nm atc 42.Nd air traffic controller game 43.Sh SYNOPSIS 44.Nm atc 45.Op Fl lpqst 46.Op Fl f Ar game 47.Op Fl g Ar game 48.Op Fl r Ar seed 49.Sh DESCRIPTION 50.Nm 51lets you try your hand at the nerve-wracking duties of an air traffic 52controller without endangering the lives of millions of 53travelers each year. 54Your responsibilities require you to direct the flight of jets 55and prop planes into and out of the flight arena and airports. 56The speed 57.Pq update time 58and frequency of the planes depend on the 59difficulty of the chosen arena. 60.Bl -tag -width "-g gamex" 61.It Fl f Ar game 62Play the named 63.Ar game . 64If the game listed is not one of the ones printed by the 65.Fl l 66option, the default game is played. 67.It Fl g Ar game 68Same as 69.Fl f . 70.It Fl l 71Print a list of available games and exit. 72The first game name printed is the default game. 73.It Fl p 74Print the path to the special directory where 75.Nm 76expects to find its private files. 77This is used during the installation of the program. 78.It Fl q 79Play quietly 80.Pq no bells . 81.It Fl r Ar seed 82Set the random seed. 83This option can be used to replay a specific game. 84.It Fl s 85Print the score list 86.Pq formerly the Top Ten list . 87The scoring information is the game time in 88.Dq radar updates , 89the wall-clock game time, and the number of planes that were 90successfully dealt with. 91.It Fl t 92Same as 93.Fl s . 94.El 95.Sh GOALS 96Your goal in 97.Nm 98is to keep the game going as long as possible. 99There is no winning state, except to beat the times of other players. 100You will need to: launch planes at airports 101.Po 102by instructing them to increase their altitude 103.Pc ; 104land planes at airports 105(by instructing them to go to altitude zero when exactly over the airport); 106and maneuver planes out of exit points. 107.Pp 108Several things will cause the end of the game. 109Each plane has a destination 110.Pq see information area , 111and sending a plane to the wrong destination is an error. 112Planes can run out of fuel, or can collide. 113Collision is defined as adjacency, horizontal or vertical. 114A plane leaving the arena in any other way than through its correct 115destination exit is an error as well. 116.Pp 117Scores are sorted in order of the number of planes safe. 118The other statistics are provided merely for fun. 119There is no penalty for taking longer than another player 120.Pq except in the case of ties . 121.Pp 122Suspending a game is not permitted. 123If you get a talk message, tough. 124When was the last time an Air Traffic Controller got called away to 125the phone? 126.Sh "THE DISPLAY" 127Depending on the terminal used, the 128.Nm 129screen will be divided into 4 areas. 130It should be stressed that the terminal driver portion of the 131game was designed to be reconfigurable, so the display format can vary 132depending on the version you are playing. 133The descriptions here are based on the ASCII version of the game. 134The game rules and input format, however, should remain consistent. 135Control-L redraws the screen, should it become muddled. 136.Ss RADAR 137The first screen area is the radar display, showing the relative locations 138of the planes, airports, standard entry/exit points, radar 139beacons, and 140.Dq lines 141which simply serve to aid you in guiding 142the planes. 143.Pp 144Planes are shown as a single letter with an altitude. 145If the numerical altitude is a single digit, then it represents 146thousands of feet. 147Some distinction is made between the prop planes and the jets. 148On ASCII terminals, prop planes are 149represented by an upper case letter, jets by a lower case letter. 150.Pp 151Airports are shown as a number and some indication of the direction 152planes must be going to land at the airport. 153On ASCII terminals, this is one of 154.Sq ^ , 155.Sq \&> , 156.Sq \&< , 157or 158.Sq v , 159to indicate 160north 161.Pq 0 degrees , 162east 163.Pq 90 , 164west 165.Pq 270 , 166and south 167.Pq 180 , 168respectively. 169The planes will also take off in this direction. 170.Pp 171Beacons are represented as circles or asterisks and a number. 172Their purpose is to offer a place of easy reference to the plane pilots. 173See 174.Sx The Delay Command 175under the input section of this manual. 176.Pp 177Entry/exit points are displayed as numbers along the border of the 178radar screen. 179Planes will enter the arena from these points without warning. 180These points have a direction associated with them, and 181planes will always enter the arena from this direction. 182On the ASCII version of 183.Nm atc , 184this direction is not displayed. 185It will become apparent what this direction is as the game progresses. 186.Pp 187Incoming planes will always enter at the same altitude: 7000 feet. 188For a plane to depart successfully through an entry/exit point, 189it must be flying at 9000 feet. 190It is not necessary for the planes to be flying in any particular 191direction when they leave the arena 192.Pq yet . 193.Ss "INFORMATION AREA" 194The second area of the display is the information area, which lists 195the time 196.Pq number of updates since start 197and the number of planes you 198have directed safely out of the arena. 199Below this is a list of planes currently in the air, followed by a 200blank line, and then a list of planes on the ground 201.Pq at airports . 202Each line lists the plane name and its current altitude, 203an optional asterisk indicating low fuel, the plane's destination, 204and the plane's current command. 205Changing altitude is not considered 206to be a command and is therefore not displayed. 207The following are some possible information lines: 208.Pp 209.Dl B4*A0: Circle @ b1 210.Pp 211.Dl g7 E4: 225 212.Pp 213The first example shows a prop plane named 214.Sq B 215that is flying at 4000 216feet. 217It is low on fuel (note the 218.Sq * ) . 219Its destination is 220Airport #0. 221The next command it expects 222to do is circle when it reaches Beacon #1. 223The second example shows a jet named 224.Sq g 225at 7000 feet, destined for 226Exit #4. 227It is just now executing a turn to 225 degrees 228.Pq Southwest . 229.Ss "INPUT AREA" 230The third area of the display is the input area. 231It is here that your input is reflected. 232See the 233.Sx INPUT 234heading of this manual for more details. 235.Ss "AUTHOR AREA" 236This area is used simply to give credit where credit is due. :-) 237.Sh INPUT 238A command completion interface is built into 239the game. 240At any time, typing 241.Sq \&? 242will list possible input characters. 243Typing a backspace 244.Pq your erase character 245backs up, erasing the last part of the command. 246When a command is complete, a return enters it, and 247any semantic checking is done at that time. 248If no errors are detected, the command is sent to the appropriate plane. 249If an error is discovered 250during the check, the offending statement will be underscored and a 251.Pq somewhat 252descriptive message will be printed under it. 253.Pp 254The command syntax is broken into two parts: 255.Em Immediate Only 256and 257.Em Delayable 258commands. 259.Em Immediate Only 260commands happen on the next 261update. 262.Em Delayable 263commands also happen on the next update unless they 264are followed by an optional predicate called the 265.Em Delay 266command. 267.Pp 268In the following tables, the syntax 269.Em [0\-9] 270means any single digit, and 271.Em <dir> 272refers to the keys around the 273.Sq s 274key, namely 275.Dq wedcxzaq . 276In absolute references, 277.Sq q 278refers to Northwest or 315 degrees, and 279.Sq w 280refers to North, or 0 degrees. 281In relative references, 282.Sq q 283refers to \-45 degrees or 45 degrees left, and 284.Sq w 285refers to 0 degrees, or no change in direction. 286.Pp 287All commands start with a plane letter. 288This indicates the recipient of the command. 289Case is ignored. 290.Ss "IMMEDIATE ONLY COMMANDS" 291.Bd -ragged 292.Bl -tag -width "aaaa" 293.It Sy "a [ cd+- ]" Em number 294Altitude: 295Affect a plane's altitude, possibly requesting takeoff. 296.Sq \&+ 297and 298.Sq \&- 299are the same as 300.Sq c 301and 302.Sq d . 303.Bl -tag -width "aaaaaaaaaa" -compact 304.It Sy a [0\-9] 305Go to the given altitude 306.Pq thousands of feet . 307.It Sy c [0\-9] 308Climb: 309Relative altitude change 310.Pq thousands of feet . 311.It Sy d [0\-9] 312Descend: 313Relative altitude change 314.Pq thousands of feet . 315.El 316.It Sy m 317Mark: 318Display in highlighted mode. 319Plane and command information is displayed normally. 320.It Sy i 321Ignore: 322Do not display highlighted. 323Command information is displayed as a line of dashes if there is no command. 324.It Sy u 325Unmark: 326Same as ignore, but if a delayed command is processed, 327the plane will become marked. 328This is useful if you want to forget about a plane during part, but not 329all, of its journey. 330.El 331.Ed 332.Ss "DELAYABLE COMMANDS" 333.Bd -ragged 334.Bl -tag -width "aaaa" 335.It Sy c 336Circle: 337Have the plane circle. 338.It Sy "t [ l-r+LR ] [ dir ]" No or Sy "tt [ abe* ]" Em number 339Turn: 340Change direction. 341.Bl -tag -width "aaaaaaaaaa" -compact 342.It Sy t<dir> 343Turn to the absolute compass heading given. 344The shortest turn will be taken. 345.It Sy tl 346Left: 347Turn counterclockwise 348.Pq 45 degrees by default . 349.Bl -tag -width "tl <dir>" -compact 350.It Sy tl <dir> 351Turn ccw the given number of degrees. 352Zero degrees 353.Pq Sq w 354is no turn; 45 degrees ccw is 355.Sq e . 356The shortest turn will be taken; for instance, if you specify 357a ccw turn of 315 degrees 358.Pq Sq q , 359which should take several turns, 360the plane will really turn 45 cw, which takes only one turn. 361.El 362.It Sy tr 363Right: 364Turn clockwise 365.Pq 45 degrees by default . 366.Bl -tag -width "tl <dir>" -compact 367.It Sy tr <dir> 368Analogous to turn left <dir>. 369.El 370.It Sy tL 371Turn counterclockwise 90 degrees. 372.It Sy tR 373Turn clockwise 90 degrees. 374.It Sy "tt [abe*]" 375Towards: 376Turn towards a beacon, airport or exit. 377The turn is just an estimate. 378.Bl -tag -width "aaaaaaaaaa" -compact 379.It Sy ttb Em number 380Turn towards the specified beacon. 381.It Sy tt* Em number 382Equivalent to 383.Sy ttb . 384.It Sy tte Em number 385Turn towards the specified exit. 386.It Sy tta Em number 387Turn towards the specified airport. 388.El 389.El 390.El 391.Ed 392.Ss "THE DELAY COMMAND" 393The 394.Em Delay 395(a/@) 396command may be appended to any 397.Em Delayable 398command. 399It allows the controller to instruct a plane to do an action 400when the plane reaches a particular beacon 401.Pq or other objects in future versions . 402.Bd -ragged -offset indent 403.Bl -tag -width indent -compact 404.It Sy a/@ 405At: 406Do the given delayable command when the plane reaches the given beacon. 407.Bl -tag -width "aaaaaaaaaa" -compact 408.It Sy ab Em number 409The letter is redundant to allow for expansion. 410.Sq \&@ 411can be used instead of 412.Sq a . 413.El 414.El 415.Ed 416.Ss "MARKING, UNMARKING AND IGNORING" 417Planes are 418.Em marked 419by default when they enter the arena. 420This means they are displayed in highlighted mode on the radar display. 421A plane may also be either 422.Em unmarked 423or 424.Em ignored . 425An 426.Em unmarked 427plane is drawn in unhighlighted mode, and a line of dashes is displayed in 428the command field of the information area. 429The plane will remain this way until a mark command has been issued. 430Any other command will be issued, 431but the command line will return to a line of dashes when the command 432is completed. 433.Pp 434An 435.Em ignored 436plane is treated the same as an unmarked plane, except that it will 437automatically switch to 438.Em marked 439status when a delayed command has been processed. 440This is useful if you want to forget about a plane for a while, 441but its flight path has not yet been completely set. 442.Pp 443As with all of the commands, marking, unmarking and ignoring will take effect 444at the beginning of the next update. 445Do not be surprised if the plane does 446not immediately switch to unhighlighted mode. 447.Ss EXAMPLES 448.Bd -ragged -offset indent 449.Bl -tag -width "gtte4ab2" 450.It atlab1 451Plane A: turn left at beacon #1 452.It cc 453Plane C: circle 454.It gtte4ab2 455Plane G: turn towards exit #4 at beacon #2 456.It ma+2 457Plane M: altitude: climb 2000 feet 458.It stq 459Plane S: turn to 315 460.It xi 461Plane X: ignore 462.El 463.Ed 464.Sh "OTHER INFORMATION" 465.Bl -bullet 466.It 467Jets move every update; prop planes move every other update. 468.It 469All planes turn at most 90 degrees per movement. 470.It 471Planes enter at 7000 feet and leave at 9000 feet. 472.It 473Planes flying at an altitude of 0 crash if they are not over an airport. 474.It 475Planes waiting at airports can only be told to take off 476.Pq climb in altitude . 477.It 478Pressing return 479.Pq that is, entering an empty command 480will perform the next update immediately. 481This allows the player to 482.Dq fast forward 483the game clock if nothing interesting is happening. 484.El 485.Sh "NEW GAMES" 486The 487.Pa Game_List 488file lists the currently available play fields. 489New field description file names must be placed in this file to be 490playable. 491If a player specifies a game not in this file, his score will not be logged. 492.Pp 493The game field description files are broken into two parts. 494The first part is the definition section. 495Here, the four tunable game parameters must be set. 496These variables are set with the syntax: 497.Pp 498.Dl "variable = number;" 499.Pp 500Variable may be one of: 501.Li update , 502indicating the number of seconds between forced updates; 503.Li newplane , 504indicating 505.Pq about 506the number of updates between new plane entries; 507.Li width , 508indicating the width of the play field; or 509.Li height , 510indicating the height of the play field. 511.Pp 512The second part of the field description files describes the locations 513of the exits, the beacons, the airports and the lines. 514The syntax is as follows: 515.Bd -ragged -offset indent 516.Bl -tag -width "airport:" -compact 517.It beacon : 518(x y) ... ; 519.It airport : 520(x y direction) ... ; 521.It exit : 522(x y direction) ... ; 523.It line : 524[ (x1 y1) (x2 y2) ] ... ; 525.El 526.Ed 527.Pp 528For beacons, a simple x, y coordinate pair is used 529.Pq enclosed in parentheses . 530Airports and exits require a third value, a direction, which is one 531of 532.Dq wedcxzaq . 533For airports, this is the direction that planes must be going to take 534off and land, and for exits, this is the direction that planes will be going 535when they enter 536the arena. 537This may not seem intuitive, but as there is no restriction on 538direction of exit, this is appropriate. 539Lines are slightly different, since they need two coordinate pairs to 540specify the line endpoints. 541These endpoints must be enclosed in square brackets. 542.Pp 543All statements are semi-colon (;) terminated. 544Multiple item statements accumulate. 545Each definition must occur exactly once, before any 546item statements. 547Comments begin with a hash (#) symbol 548and terminate with a newline. 549The coordinates are between zero and width-1 and height-1 550inclusive. 551All of the exit coordinates must lie on the borders, and 552all of the beacons and airports must lie inside of the borders. 553Line endpoints may be anywhere within the field, so long as 554the lines are horizontal, vertical or 555.Em exactly 556diagonal. 557.Ss "FIELD FILE EXAMPLE" 558.Bd -literal -offset indent 559# This is the default game. 560 561update = 5; 562newplane = 5; 563width = 30; 564height = 21; 565 566exit: ( 12 0 x ) ( 29 0 z ) ( 29 7 a ) ( 29 17 a ) 567 ( 9 20 e ) ( 0 13 d ) ( 0 7 d ) ( 0 0 c ) ; 568 569beacon: ( 12 7 ) ( 12 17 ) ; 570 571airport: ( 20 15 w ) ( 20 18 d ) ; 572 573line: [ ( 1 1 ) ( 6 6 ) ] 574 [ ( 12 1 ) ( 12 6 ) ] 575 [ ( 13 7 ) ( 28 7 ) ] 576 [ ( 28 1 ) ( 13 16 ) ] 577 [ ( 1 13 ) ( 11 13 ) ] 578 [ ( 12 8 ) ( 12 16 ) ] 579 [ ( 11 18 ) ( 10 19 ) ] 580 [ ( 13 17 ) ( 28 17 ) ] 581 [ ( 1 7 ) ( 11 7 ) ] ; 582.Ed 583.Sh ENVIRONMENT 584.Bl -tag -width LOGNAMEXXX 585.It Ev LOGNAME 586Name to be recorded in high score file. 587.El 588.Sh FILES 589Files are kept in a special directory, which can be shown by using the 590.Fl p 591flag. 592.Pp 593.Bl -tag -width "/usr/share/games/atc/Game_List" -compact 594.It Pa $HOME/.atc.scores 595Score file. 596.It Pa /usr/share/games/atc/Game_List 597The list of playable games. 598.El 599.Sh AUTHORS 600.An -nosplit 601.An \&Ed James , 602UC Berkeley: 603.Mt edjames@ucbvax.berkeley.edu , 604.Mt ucbvax!edjames 605.Pp 606This game is based on someone's description of the overall flavor 607of a game written for some unknown PC many years ago, maybe. 608.Sh BUGS 609The screen sometimes refreshes after you have quit. 610