Newsgroups: comp.ai.genetic
Path: cantaloupe.srv.cs.cmu.edu!das-news2.harvard.edu!news2.near.net!news.mathworks.com!europa.eng.gtefsd.com!darwin.sura.net!news.Vanderbilt.Edu!NewsWatcher!user
From: goldenjb@ctrvax.vanderbilt.edu (jim golden)
Subject: Re: Genesis for DOS?
Message-ID: <goldenjb-241094103201@129.59.170.62>
Followup-To: comp.ai.genetic
Sender: news@news.vanderbilt.edu
Nntp-Posting-Host: 129.59.170.62
Organization: vanderbilt
References: <388pik$qa7@giga.bga.com> <23OCT199413004764@violet.ccit.arizona.edu> <goldenjb-231094185019@129.59.170.62> <dab-2310941940450001@mote.tiac.net>
Date: Mon, 24 Oct 1994 15:13:05 GMT
Lines: 157

In article <dab-2310941940450001@mote.tiac.net>, dab@mote.tiac.net (Dana
Basken) wrote:


> 
> I'd be very interested in snagging a copy of the Mac version, if you can
> release it to the public!
> 
> Thanks!
> 
> > Jim
> 
> - Dana
> 
> -- 
> Dana Basken              |         "Ya, but I know this grapevine"
> dab@mote.tiac.net        |                       - Johnny Dangerously

I had a lot of help from Mike Morgan.  Here are the changes he suggested
that worked very well.  All credit goes to him...

Jim
--------------------------------------------------In article
<rjsullivan-010694153422@146.80.11.87>, rjsullivan@dra.hmg.gb (Dr Robert J
Sullivan) wrote:

>I would be very grateful if someone could point me in the right direction for a port of GENESIS 5.0 to the Macintosh. In particular, for the THINKC 6.0 compiler. I am having difficulty compiling report.c due to a code overflow error. I am also unsure how to implement the curses stuff using THINKC console functions.

>Thanks in Advance,

>Rob Sullivan

I'm using ThinkC 5.0.4 instead of 6.0, and I haven't tested everything, but
this should still help. I haven't yet tried to compile "report.c".

My ThinkC project includes the following files in the first segment: 

ANSI, main.c, setup.c

Note I have incorporated the setup program into the main application. I was
also planning on doing this with the report program as well. 

The following files are in the second segment: 

best.c, checkpnt.c, convert.c, cross.c, display.c, done.c, elitist.c
error.c, eval.c, evaluate.c, generate.c, init.c, input.c, measure.c
mutate.c, restart.c, schema.c, select.c

I'm not using any prefix option.

I made these changes to "define.h":

Insert the following among the include files: 

#include <stdlib.h>

In system dependencies, define the following: 

#define TURBOC 0
#define UNIX 0
#define MAC	1

Also in system dependencies, replace the "#else" with: 

#elif TURBOC

Finally, insert the following prior to the "#endif": 

#elif MAC
#include <console.h>
#define refresh()	fflush(stdout)
#define printw	printf
#define scanw	scanf
#define getw	gets

I made this change to "extern.h":

Remove the "calloc" and "malloc" definitions for MAC as follows: 

#if MAC
#else
char *calloc();
char *malloc();
#endif

I made this change to function "main" in "main.c": 

Instead of just invoking "Input", do the following: 

/* see input.c for the use of command line args */ argc = ccommand(&argv);
setup (argc ? argv[1] : "");
Input(argc,argv);
cshow (stdout);

I made these changes to "display.c":

Insert the following prior to the function "die": 

#if MAC

die(void) {
exit(0);
}

move (row, col)
int row, col;
{
cgotoxy (col+1, row+1, stdout);
}

clear()
{
cgotoxy (1, 1, stdout);
ccleos (stdout);
}

getstr(s)
char *s;
{
gets(s);
}

initscr() {}

clrtoeol()
{
ccleol (stdout);
}

#else

And insert the following after the function "die": 

#endif

I made these changes to function "main" in "setup.c": 

Replace "main()" with "setup(char *suffix)" 

Before the first "printf", insert the following: 

/* check if user wants to do setup */
printf("Set up input? [n]: ");
getstring(s);
if (strlen(s) == 0 || strcmp(s, "n") == 0) return; 

Since the user enters the file suffix in the command line dialog, I
commented out the following:

/*	printf("File suffix []: ");
getstring(s); */

and inserted the following in its place: 

strcpy (s, suffix);

- Mike Morgan, mmorgan@holonet.net
