From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jean Louis Newsgroups: gmane.emacs.help Subject: Re: Lisp Live buffer Date: Fri, 23 Dec 2022 11:15:16 +0300 Message-ID: References: <87sfhsczaa.fsf@dataswamp.org> <8A1A0B61-1853-4EEE-AB2E-A5975D8B8241@gnu.support> <87lenjq35z.fsf@dataswamp.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="12898"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mutt/2.2.9+54 (af2080d) (2022-11-21) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Fri Dec 23 09:16:43 2022 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1p8dER-00038D-11 for geh-help-gnu-emacs@m.gmane-mx.org; Fri, 23 Dec 2022 09:16:43 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p8dDj-0004mT-1y; Fri, 23 Dec 2022 03:15:59 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p8dDX-0004k1-QJ for help-gnu-emacs@gnu.org; Fri, 23 Dec 2022 03:15:49 -0500 Original-Received: from stw1.rcdrun.com ([217.170.207.13]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p8dDV-0005mW-7E for help-gnu-emacs@gnu.org; Fri, 23 Dec 2022 03:15:47 -0500 Original-Received: from localhost ([::ffff:102.85.128.226]) (AUTH: PLAIN admin, TLS: TLS1.3,256bits,ECDHE_RSA_AES_256_GCM_SHA384) by stw1.rcdrun.com with ESMTPSA id 0000000000055D73.0000000063A563AF.00007A4B; Fri, 23 Dec 2022 01:15:42 -0700 Mail-Followup-To: help-gnu-emacs@gnu.org Content-Disposition: inline In-Reply-To: <87lenjq35z.fsf@dataswamp.org> Received-SPF: pass client-ip=217.170.207.13; envelope-from=bugs@gnu.support; helo=stw1.rcdrun.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:141912 Archived-At: * Emanuel Berg [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