comp.lang.ada
 help / color / mirror / Atom feed
* Passive Data...
@ 1998-02-08  0:00 Jason Welbourne
  0 siblings, 0 replies; only message in thread
From: Jason Welbourne @ 1998-02-08  0:00 UTC (permalink / raw)



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




^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1998-02-08  0:00 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-02-08  0:00 Passive Data Jason Welbourne

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox