Recent

Author Topic: Othello  (Read 3544 times)

Dzandaa

  • Hero Member
  • *****
  • Posts: 502
  • From C# to Lazarus
Othello
« on: August 21, 2025, 05:11:36 pm »
Hi everybody,

Here's a little game I wrote a long time ago (it was in C or C++ back then with chars printed on the screen) based on the game Othello Reversi.
I remade an adaptation in Pascal Lazarus when I started learning it in 2021.

This is also my first "IA" :)

Have fun.

B->
Regards,
Dzandaa

speter

  • Sr. Member
  • ****
  • Posts: 452
Re: Othello
« Reply #1 on: August 22, 2025, 09:25:33 am »
Thanks Dzandaa! Nice work.

I've attached yet another Othello :)
This game I originally wrote in 2001 (in Delphi), this version is much "cleaned-up". :)

It is quite similar to Dzandaa's except I use single-mouse-clicks (instead of double-clicks).
I didn't look at Dzandaa's logic (for the computer's move), but I do remember mine was pretty poor.

cheers
S.
I climbed mighty mountains, and saw that they were actually tiny foothills. :)

Dzandaa

  • Hero Member
  • *****
  • Posts: 502
  • From C# to Lazarus
Re: Othello
« Reply #2 on: August 22, 2025, 11:37:45 am »
Hi,

Hi,
@Speter:

I found a version I wrote in C++ in 2001 too :)
another in 2017 in C#.
I haven't found the C version which has disappeared in the mists of time.
Did you know that the game was invented in 1883, and the only computer available to humans was their brains? :)

Good day.

B->
Regards,
Dzandaa

Roland57

  • Hero Member
  • *****
  • Posts: 532
    • msegui.net
Re: Othello
« Reply #3 on: August 22, 2025, 08:59:21 pm »
@Dzandaa

Beautiful! Thank you for sharing. Works perfectly under Linux.

@speter

Very nice too. It is a little disturbing not to see player's move, as computer plays instantly. But the graphics are very well done.

After reading this discussion, I searched and found several other Othellos written in Pascal. This one (for Mac OS) is very impressive:

http://cassio.free.fr/

There is an attempt for a multiplatform version:

https://github.com/snicolet/cassio
My projects are on Codeberg.

speter

  • Sr. Member
  • ****
  • Posts: 452
Re: Othello
« Reply #4 on: August 23, 2025, 01:46:50 am »
@speter

Very nice too. It is a little disturbing not to see player's move, as computer plays instantly. But the graphics are very well done.
Until my "clean-up" yesterday, my program _did_ refresh after the human move, but I thought the computer's move was sufficiently fast that it wasn't needed.  :o

To fix this, add "refresh" after line 929, as below:
Code: Pascal  [Select][+][-]
  1.   if board[cp.x,cp.y] = valid then
  2.     begin
  3.       clearValid;
  4.       moveto(human,cp);
  5.       refresh;
  6.     end;
  7.  

cheers
S.
I climbed mighty mountains, and saw that they were actually tiny foothills. :)

Roland57

  • Hero Member
  • *****
  • Posts: 532
    • msegui.net
Re: Othello
« Reply #5 on: August 23, 2025, 10:28:37 am »
To fix this, add "refresh" after line 929, as below:

Thank you for your answer. I had to move moveto procedure declaration to compile the program after that modification. And I still don't see (the result of) my move. Maybe what I say is not clear. Anyway I wouldn't want to bore you with that detail, and we should not highjack Dzaanda's thread.  :)
My projects are on Codeberg.

 

TinyPortal © 2005-2018