From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=0.1 required=5.0 tests=BAYES_05,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,2c71906906524bea,start X-Google-Attributes: gid103376,public From: Jason Welbourne Subject: Passive Data... Date: 1998/02/08 Message-ID: #1/1 X-Deja-AN: 323314782 Sender: Ada programming language Comments: Gated by NETNEWS@AUVM.AMERICAN.EDU MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Newsgroups: comp.lang.ada Date: 1998-02-08T00:00:00+00:00 List-Id: I have a question of sorts. I am a college student at AUM (Auburn Universtiy at Montgomery) and I am taking a computer sciences course this quarter. I have some background in computer science, but with different languages. We were recently asked to write a TicTacToe program for class, which in and of itself is not that hard. This program has taught me the fundamentals of Ada, but I have some remaining questions. With 500 lines of source code, I have created the basic thing. accepts 2 players, human or computer. Computer uses logic to create responses. Goes through 4 levels. Checks for winnig move, then blocking move, then consults a file which is recorded at the end of every game, containing game info. It calculates which move brought about a win most often in the past, and responds with that move. If nothing has been founf yet, it responds at random. It works fine, and I like it, but it recently occured to me that I could expand upon it. Our lab uses a multi-user linux server, and I wanted to allow games between seperately logged in users. Also, I wanted to create a Database which would be continuously stored in memory, and use an executable program to acccess this database. This would allow a large number of players to play each other, even if they were telnetted in from across the world. I would take the alylitical procedures from my original executable, and add them to the Preelaborated package. All the main program would do is get the players name, look him up in the database, show him a list of availible parties who are running the program, waiting for an opponent. Once an opponent was found, the would be assigned a GameID, and the Executable would send information to the package a neccesary. If I can get it to work, I was even going to make some computer "players" who acted as real people. Here's what I have dome. == TTT_Data.ads == package TTT_Data is pragma Shared_Passive; subtype Square is Integer range 0 .. 2; type Board is array(1 .. 9) of Square; type Player_Type is record .. end record; type Game_Type is record .. end record; function Get_Computers_Move return Integer; . . . end TTT_Data; == TTT_Data.adb == package body TTT_Main is . . . end TTT_Main; == TicTacToe.adb == with Standard_IO; with TTT_Data; use Standard_IO; Procedure TicTacToe is ... Begin ... End; ==== As evidenced by the fact that I am writing this, it doesn't work. the TTT_Data thing compiles and says no Main procedure, so it creates no executable. If there is no executable, how does the memory ever become allocated for all of that Data??? TicTacToe.adb will not compile. Anytime I reference any of this data that I am assuming has been allocated, it says that the variable has not been declared. PLEASE HELP!!! Send E-Mail responses to welbjas@sciences.aum.edu Any help will be much appriciated... Jason Welbourne