help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Lisp Live buffer


From: Jean Louis
Subject: Re: Lisp Live buffer
Date: Fri, 23 Dec 2022 11:15:16 +0300
User-agent: Mutt/2.2.9+54 (af2080d) (2022-11-21)

* Emanuel Berg <incal@dataswamp.org> [2022-12-07 15:09]:
> Jean Louis wrote:
> 
> > Just use prin1-to-string and insert updated structure
> > in intervals.
> 
> For example this WarGames Spanish football game?
> 
> (setq ttt-board
>   (list
>     '(x o o)
>     '(· x ·)
>     '(· · x) ))
> 
> Next cool thing would be there would not be any 'score' or
> other stats stored in variables, instead that would be
> computed from the board (game world) each time ...

When you mention it, I must think that there must be some variable
telling who was the last player, as for game to determine who wins it.

Deviation from subject:

I can only guess that such game exist in Emacs. Though I could use my
package rcd-box.el to construct the interface.

(rcd-box-table '(("X" " " "X")
                 (" " "X" "O")
                 (" " " " "O"))) ➜ "
╔═══╦═══╦═══╗
║ X ║   ║ X ║
╠═══╬═══╬═══╣
║   ║ X ║ O ║
╠═══╬═══╬═══╣
║   ║   ║ O ║
╚═══╩═══╩═══╝

"

And I know I can insert buttons as well, by using RCD Utilities
function `rcd-button-insert', see footnote.

(insert 
 (rcd-box-table (list (list "X" " " (with-temp-buffer (rcd-button-insert "X" 
'ignore) (buffer-string)))
                      '(" " "X" "O")
                      '(" " " " "O"))))
╔═══╦═══╦═══╗
║ X ║   ║ X ║ <--- this X becomes visible as button
╠═══╬═══╬═══╣
║   ║ X ║ O ║
╠═══╬═══╬═══╣
║   ║   ║ O ║
╚═══╩═══╩═══╝

Buttons may have it's functions, so clicking on the button could
remove or eventually place something in the list, and redraw the
table.

Somebody called Gomoku Tic Tac Toe, but it is not same, though similar.

Emacs Tic Tac Toe. It is called gomoku in Emacs. Use the… | by Akash Manohar | 
1 command a day | Medium:
https://medium.com/1cmd/emacs-tic-tac-toe-81a334fd3fd7

Version exists here, but the author hosted images at imgur.com which are not 
available any more:

accidentalrebel/emacs-tic-tac-toe-improved: An improved tic-tac-toe game 
project for me to practice my Emacs Lisp.:
https://github.com/accidentalrebel/emacs-tic-tac-toe-improved

Other version is here:
https://github.com/accidentalrebel/emacs-tic-tac-toe-game/blob/master/tic-tac.el

That is such a boring game, and also unfair, as once trick is known, there will 
be too many wins.

-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

In support of Richard M. Stallman
https://stallmansupport.org/

GNU Emacs package: rcd-utilities.el :
https://gnu.support/gnu-emacs/packages/rcd-utilities-el.html



reply via email to

[Prev in Thread] Current Thread [Next in Thread]