mainsworthy source code released

Discussion of chess software programming and technical issues.

Moderator: Ras

mainsworthy

Re: mainsworthy source code released

Post by mainsworthy »

if you remember way back when mainsworthy appeared , it was just a text chess game, built as a home project, I never believed it would be playing in winboard arena and fritz with a wb2uci interface.

I actualy ran a computer dept, with dbase and novel network and payroll for 1200 people, I had reports to program, but that was 20years ago now :)

I dont class c++ as my favourite language, I hate it, but some thing have to be done in c++ , Im not comfatable with local variables thats why I pass arrays.

I am self tought in many programing environments, but I muddle through
mainsworthy

Re: mainsworthy source code released

Post by mainsworthy »

Ive programed over the years in c++, c,pascal cobol, basic, dbase, assembly, even (opp-codes with no assembler) peeking and poking MS-DOS I am self tought alot but not selftought in programing!

Im justing spouting off about rubbish here, its just I cant get over saying a chess programer is a beginer :) no-problem though , I can c why
User avatar
ilari
Posts: 750
Joined: Mon Mar 27, 2006 7:45 pm
Location: Finland

Re: mainsworthy source code released

Post by ilari »

mainsworthy wrote:Thanks all for your comments! I didnt have a clue before hand how to program chess but Im not a biginer Ive programing been since 1980, and I have studied at poly and have a C&G in cobol programming, I have plenty of programs around the net for Mac Linux and windows like wargames etc..
Okay, I'm sorry about mistaking you for a beginner, obviously you've been programming much much longer than I have. Your Cobol background explains Mainsworthy's style of C++ pretty well.

BUT I KNOW the code is badly set out, the code went well untill I didnt know how to program a chess engine, it was all trial and error after that(shoving variable and arrays around around etc...),...
It was the same thing for me when I wrote Sloppy - I learned C and chess programming on the way and the codebase had many complete rewrites due to bad design and unorthodox practices. I'm still not satisfied with the code, and I wish I had enough time to start over once again.
if you look at the include files there a bit clearer than the main program.
I didn't find any include files (*.h). Maybe I'm missing something?
My programing style is my own and I dont expect you to understand it easy, I do things in my prgrams this way because Im not getting paid, and I can reuse code in my own programs better than object programming. Im not defending my style I do know its mess, but , the proof is in the eating, it plays chess !+ and it has given me an understanding I would not of had about programing a chess engine.
I was honestly trying to help. I wish someone had told me about coding conventions and style guides before I started writing a chess engine. It's not just about conforming to the masses and obeying the programming gods, but most of the rules are demonstrably beneficial to the programmer and hard to argue against.

Hey and if you look at the code you will see me trying to hand code a negamax, untill i found the proper algo
I saw that, and found it confusing. Why do you keep stuff like that in your public sources? If you want to preserve the editing history you should use a version control system.

I dont class c++ as my favourite language, I hate it, but some thing have to be done in c++ , Im not comfatable with local variables thats why I pass arrays.
If you're not comfortable with local arrays then it wouldn't actually be far from the truth to call you a beginning C/C++ programmer. Seriously, this is basic, fundamental stuff.
User avatar
ilari
Posts: 750
Joined: Mon Mar 27, 2006 7:45 pm
Location: Finland

Re: mainsworthy source code released

Post by ilari »

mcostalba wrote:When and if you have nothing better to do I would really appreciate if you could give a look at SF coding style and highlight me some weak points and possible improvments.

As I have already stated in other posts your code is the best around I have looked so far, so I really evaluate your opinion.

Thanks
Thanks, that's very flattering. It's a lot easier to write pretty and clean code when you don't have to care that much about low-level performance, which is the case with Cute Chess.

It just so happens that I do have some notes about Stockfish's code, I'll post them in a separate thread.
mainsworthy

Re: mainsworthy source code released

Post by mainsworthy »

Hi Ilari, I know you were trying to help , I like what you said :) I probably will look into all you said, I just felt I had to say I can program already, but there is always room for improvement.

you can include *.cpp aswell as *.h files (another mainsworthy type logic) :)
mainsworthy

Re: mainsworthy source code released

Post by mainsworthy »

another example of my work here is a tile mapper

http://download.cnet.com/MAP-it/3000-66 ... =mncol;lst

ive done plenty more finding them isnt easy
mainsworthy

Re: mainsworthy source code released

Post by mainsworthy »

heres my program MAP MUD on a magazine cd

http://www.magnesiummedia.com/pcutilities/

http://www.magnesiummedia.com/pcutiliti ... 45842.html

im just haveing fun, with the excuse of finding old programs