www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/10/17/13:35:10

Message-ID: <001b01c03860$e5469d40$2813ddcc@default>
From: "Josh Haglund" <lhaglund AT wiktel DOT com>
To: <djgpp AT delorie DOT com>
Subject: Programming
Date: Tue, 17 Oct 2000 12:37:16 -0500
MIME-Version: 1.0
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 5.50.4133.2400
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400
Reply-To: djgpp AT delorie DOT com

Hello everyone!

I'm need some help writing some code.

I have this chess program... and I want to write a simple configuration file
or .ini file for it.

For example... if it looked something like this.

------------------------------
st 10
sd 6
------------------------------

Now "st" stands for set time and "sd" stands for set depth.
I want my chess program to open or read the .ini file and change the default
settings.
I don't know how to _write it_. Could someone give me some help?

Here's a peice of it's code.

        if (!strcmp(s, "st")) {
            scanf("%d", &max_time);
            max_time *= 100000000;
            max_depth = 10000;
            continue;
        }
        if (!strcmp(s, "sd")) {
            scanf("%d", &max_depth);
            max_time = 1000000000;
            continue;
        }

Thanks for your time,

Josh Haglund
lhaglund AT wiktel DOT com

P.S. I can compile in Dev C++, I still have to try with djgpp. :)


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019