Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #400519 > unrolled thread

Tic Tac Toe Quest

Started byBonita Montero <Bonita.Montero@gmail.com>
First post2026-07-29 14:10 +0200
Last post2026-08-04 13:49 +0800
Articles 20 on this page of 86 — 23 participants

Back to article view | Back to comp.lang.c


Contents

  Tic Tac Toe Quest Bonita Montero <Bonita.Montero@gmail.com> - 2026-07-29 14:10 +0200
    Re: Tic Tac Toe Quest Chris Ahlstrom <OFeem1987@teleworm.us> - 2026-07-29 08:14 -0400
      Re: Tic Tac Toe Quest Bonita Montero <Bonita.Montero@gmail.com> - 2026-07-29 14:28 +0200
        Re: Tic Tac Toe Quest Johann 'Myrkraverk' Oskarsson <johann@myrkraverk.invalid> - 2026-07-29 20:30 +0800
          Re: Tic Tac Toe Quest Bonita Montero <Bonita.Montero@gmail.com> - 2026-07-29 14:38 +0200
            Turbo Vision (was: Re: Tic Tac Toe Quest) Johann 'Myrkraverk' Oskarsson <johann@myrkraverk.invalid> - 2026-07-29 20:46 +0800
              Re: Turbo Vision Bonita Montero <Bonita.Montero@gmail.com> - 2026-07-29 14:57 +0200
                Re: Turbo Vision Johann 'Myrkraverk' Oskarsson <johann@myrkraverk.invalid> - 2026-07-29 21:14 +0800
                Re: Turbo Vision ... MS-DOS 5 Shell? "Mr. Man-wai Chang" <toylet.toylet@gmail.com> - 2026-07-31 22:42 +0800
                  Re: Turbo Vision ... MS-DOS 5 Shell? Johann 'Myrkraverk' Oskarsson <johann@myrkraverk.invalid> - 2026-08-05 04:13 +0800
                    Re: Turbo Vision ... MS-DOS 5 Shell? usenet@dolik.dev (Andriy D) - 2026-08-05 11:38 +0000
                    Re: Turbo Vision ... MS-DOS 5 Shell? JJ <jj4public@gmail.com> - 2026-08-05 20:46 +0700
        Re: Tic Tac Toe Quest R Kym Horsell <kym@sdf.org> - 2026-07-31 06:19 +0000
          Re: Tic Tac Toe Quest Bonita Montero <Bonita.Montero@gmail.com> - 2026-07-31 14:20 +0200
            Re: Tic Tac Toe Quest R Kym Horsell <kym@sdf.org> - 2026-07-31 22:05 +0000
              Re: Tic Tac Toe Quest steve g <Sgonedes1977@gmail.com> - 2026-08-08 01:35 -0400
                Re: Tic Tac Toe Quest R Kym Horsell <kym@sdf.org> - 2026-08-08 07:32 +0000
                  Re: Tic Tac Toe Quest steve g <Sgonedes1977@gmail.com> - 2026-08-09 19:18 -0400
          Re: Tic Tac Toe Quest James Kuyper <jameskuyper@alumni.caltech.edu> - 2026-07-31 11:22 -0400
            Re: Tic Tac Toe Quest "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2026-07-31 20:00 -0700
            Re: Tic Tac Toe Quest R Kym Horsell <kym@sdf.org> - 2026-08-02 01:17 +0000
              Re: Tic Tac Toe Quest Mike Terry <news.dead.person.stones@darjeeling.plus.com> - 2026-08-02 03:41 +0100
                Re: Tic Tac Toe Quest Mike Terry <news.dead.person.stones@darjeeling.plus.com> - 2026-08-02 04:19 +0100
                Re: Tic Tac Toe Quest R Kym Horsell <kym@sdf.org> - 2026-08-02 21:09 +0000
                  Re: Tic Tac Toe Quest Mike Terry <news.dead.person.stones@darjeeling.plus.com> - 2026-08-03 01:54 +0100
                  Re: Tic Tac Toe Quest James Kuyper <jameskuyper@alumni.caltech.edu> - 2026-08-03 17:25 -0400
                    Re: Tic Tac Toe Quest R Kym Horsell <kym@sdf.org> - 2026-08-03 22:00 +0000
                      Re: Tic Tac Toe Quest bart <bc@freeuk.com> - 2026-08-04 01:37 +0100
                        Re: Tic Tac Toe Quest bart <bc@freeuk.com> - 2026-08-04 01:58 +0100
                          Re: Tic Tac Toe Quest Mike Terry <news.dead.person.stones@darjeeling.plus.com> - 2026-08-04 03:16 +0100
                            Re: Tic Tac Toe Quest bart <bc@freeuk.com> - 2026-08-04 11:51 +0100
                        Re: Tic Tac Toe Quest Ike Naar <ike@sdf.org> - 2026-08-04 06:50 +0000
                          Re: Tic Tac Toe Quest antispam@fricas.org (Waldek Hebisch) - 2026-08-04 11:05 +0000
                      Re: Tic Tac Toe Quest James Kuyper <jameskuyper@alumni.caltech.edu> - 2026-08-04 01:05 -0400
                        Re: Tic Tac Toe Quest ... End game? TikTok? :) "Mr. Man-wai Chang" <toylet.toylet@gmail.com> - 2026-08-04 13:54 +0800
                        Re: Tic Tac Toe Quest "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2026-08-04 11:50 -0700
              Re: Tic Tac Toe Quest James Kuyper <jameskuyper@alumni.caltech.edu> - 2026-08-02 12:30 -0400
            Re: Tic Tac Toe Quest bart <bc@freeuk.com> - 2026-08-02 11:25 +0100
        Re: Tic Tac Toe Quest Chris Ahlstrom <OFeem1987@teleworm.us> - 2026-08-01 07:40 -0400
    Re: Tic Tac Toe Quest DFS <nospam@dfs.com> - 2026-07-29 15:04 -0400
      Re: Tic Tac Toe Quest Bonita Montero <Bonita.Montero@gmail.com> - 2026-07-29 21:28 +0200
        Re: Tic Tac Toe Quest DFS <nospam@dfs.com> - 2026-07-29 16:25 -0400
    Re: Tic Tac Toe Quest Bonita Montero <Bonita.Montero@gmail.com> - 2026-07-30 17:09 +0200
      Re: Tic Tac Toe Quest Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2026-07-30 17:53 +0200
        Re: Tic Tac Toe Quest Bonita Montero <Bonita.Montero@gmail.com> - 2026-07-30 21:59 +0200
          Re: Tic Tac Toe Quest Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2026-07-30 23:00 +0200
            Re: Tic Tac Toe Quest Paul <nospam@needed.invalid> - 2026-07-30 18:56 -0400
              Re: Tic Tac Toe Quest Bonita Montero <Bonita.Montero@gmail.com> - 2026-07-31 20:33 +0200
                Re: Tic Tac Toe Quest "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2026-07-31 19:53 -0700
            Re: Tic Tac Toe Quest Michael S <already5chosen@yahoo.com> - 2026-07-31 17:53 +0300
              Re: Tic Tac Toe Quest Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2026-07-31 18:17 +0200
                Re: Tic Tac Toe Quest Michael S <already5chosen@yahoo.com> - 2026-08-01 21:44 +0300
                  Re: Tic Tac Toe Quest Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2026-08-01 21:43 +0200
    Re: Tic Tac Toe Quest "Mr. Man-wai Chang" <toylet.toylet@gmail.com> - 2026-07-31 00:45 +0800
      Re: Tic Tac Toe Quest Bonita Montero <Bonita.Montero@gmail.com> - 2026-07-30 22:00 +0200
        Re: Tic Tac Toe Quest "Mr. Man-wai Chang" <toylet.toylet@gmail.com> - 2026-07-31 13:29 +0800
          Re: Tic Tac Toe Quest Johann 'Myrkraverk' Oskarsson <johann@myrkraverk.invalid> - 2026-07-31 14:54 +0800
            Re: Tic Tac Toe Quest Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2026-07-31 03:00 -0700
              Re: Tic Tac Toe Quest Johann 'Myrkraverk' Oskarsson <johann@myrkraverk.invalid> - 2026-07-31 20:57 +0800
              Re: Tic Tac Toe Quest gazelle@shell.xmission.com (Kenny McCormack) - 2026-07-31 14:08 +0000
        Re: Tic Tac Toe Quest ... Discrete mathematics? "Mr. Man-wai Chang" <toylet.toylet@gmail.com> - 2026-07-31 13:30 +0800
        Re: Tic Tac Toe Quest Lawrence D’Oliveiro <ldo@nz.invalid> - 2026-07-31 07:31 +0000
          Re: Tic Tac Toe Quest Bonita Montero <Bonita.Montero@gmail.com> - 2026-07-31 14:21 +0200
            Re: Tic Tac Toe Quest Lawrence D’Oliveiro <ldo@nz.invalid> - 2026-08-02 03:57 +0000
          Re: Tic Tac Toe Quest ... WarGames (1983) Movie CLIP - Tic Tac Toe With Joshua "Mr. Man-wai Chang" <toylet.toylet@gmail.com> - 2026-07-31 22:24 +0800
        Re: Tic Tac Toe Quest "Mr. Man-wai Chang" <toylet.toylet@gmail.com> - 2026-07-31 22:18 +0800
      Re: Tic Tac Toe Quest Johann 'Myrkraverk' Oskarsson <johann@myrkraverk.invalid> - 2026-07-31 04:17 +0800
        Re: Tic Tac Toe Quest ... game programming in C? "Mr. Man-wai Chang" <toylet.toylet@gmail.com> - 2026-07-31 13:27 +0800
          Re: Tic Tac Toe Quest ... game programming in C? Johann 'Myrkraverk' Oskarsson <johann@myrkraverk.invalid> - 2026-07-31 14:56 +0800
            Re: Tic Tac Toe Quest ... game programming in C? "Mr. Man-wai Chang" <toylet.toylet@gmail.com> - 2026-07-31 19:43 +0800
              VAXen (was: Re: Tic Tac Toe Quest ... game programming in C?) Johann 'Myrkraverk' Oskarsson <johann@myrkraverk.invalid> - 2026-07-31 20:56 +0800
                Re: VAXen The Natural Philosopher <tnp@invalid.invalid> - 2026-07-31 14:32 +0100
                  I Bought a $200K VAX on eBay & – Now It Runs My Smart Lights! - YouTube "Mr. Man-wai Chang" <toylet.toylet@gmail.com> - 2026-07-31 22:20 +0800
                    Re: I Bought a $200K VAX on eBay & – Now It Runs My Smart Lights! - YouTube Johann 'Myrkraverk' Oskarsson <johann@myrkraverk.invalid> - 2026-07-31 22:53 +0800
                      Re: I Bought a $200K VAX on eBay & – Now It Runs My Smart Lights! - YouTube The Natural Philosopher <tnp@invalid.invalid> - 2026-07-31 16:00 +0100
                Re: Tic Tac Toe Quest ... VAXen? VMS? Pascal? "Mr. Man-wai Chang" <toylet.toylet@gmail.com> - 2026-07-31 22:14 +0800
                  Re: Tic Tac Toe Quest ... VAXen? VMS? Pascal? Spreadsheets! Johann 'Myrkraverk' Oskarsson <johann@myrkraverk.invalid> - 2026-08-05 04:17 +0800
                    Re: Tic Tac Toe Quest ... VAXen? VMS? Pascal? Spreadsheets! "Mr. Man-wai Chang" <toylet.toylet@gmail.com> - 2026-08-05 07:43 -0700
    Re: Tic Tac Toe Quest... vibe-coding? Wargames (1983) the movie? "Mr. Man-wai Chang" <toylet.toylet@gmail.com> - 2026-07-31 22:43 +0800
    Tic-tac-toe (過三關? 井字棋?) - Wikipedia "Mr. Man-wai Chang" <toylet.toylet@gmail.com> - 2026-08-02 17:19 +0800
      Re: Tic-tac-toe (???? ????) - Wikipedia Your Name <YourName@YourISP.com> - 2026-08-03 10:01 +1200
        Wing Commander III: Heart of the Tiger (was: Re: Tic-tac-toe (???? ????) - Wikipedia) Johann 'Myrkraverk' Oskarsson <johann@myrkraverk.invalid> - 2026-08-03 17:15 +0800
          Re: Wing Commander III ... and Mark Hamill? Star Wars? "Mr. Man-wai Chang" <toylet.toylet@gmail.com> - 2026-08-04 13:09 +0800
        Re: Tic-tac-toe ... balance to the Force? "Mr. Man-wai Chang" <toylet.toylet@gmail.com> - 2026-08-04 13:06 +0800
        Death Star bombing run mechanical toy? "Mr. Man-wai Chang" <toylet.toylet@gmail.com> - 2026-08-04 13:14 +0800
          Re: Death Star bombing run mechanical toy? "Mr. Man-wai Chang" <toylet.toylet@gmail.com> - 2026-08-04 13:49 +0800

Page 3 of 5 — ← Prev page 1 2 [3] 4 5  Next page →


#400557

FromBonita Montero <Bonita.Montero@gmail.com>
Date2026-07-29 21:28 +0200
Message-ID<114dk9a$14ho1$1@raubtier-asyl.eternal-september.org>
In reply to#400556
Totally wrong. Try it with some code.

[toc] | [prev] | [next] | [standalone]


#400560

FromDFS <nospam@dfs.com>
Date2026-07-29 16:25 -0400
Message-ID<114dnj5$15ca1$1@dont-email.me>
In reply to#400557
On 7/29/2026 3:28 PM, Bonita Montero wrote:

> Totally wrong. Try it with some code.

same results:


#include <stdio.h>
int main(void){
	printf("Possible wins = 8\n");
	printf("Possible draw/undecided = 76\n");
	return 0;
}


[toc] | [prev] | [next] | [standalone]


#400593

FromBonita Montero <Bonita.Montero@gmail.com>
Date2026-07-30 17:09 +0200
Message-ID<114fpg4$1srkn$1@raubtier-asyl.eternal-september.org>
In reply to#400519
As no one here shows a solution I show mine in C++23:

#include <iostream>
#include <array>

using namespace std;

int main()
{
	constexpr int8_t Free = -3, White = 0, Black = 1;
	array<array<int8_t, 3>, 3> board;
	board.fill( { Free, Free, Free } );
	unsigned undecided = 0, wins = 0;
	auto recurse = [&]( this auto &self, int8_t colour ) noexcept -> void
	{
		bool full = true;
		for( size_t row = 3; row--; )
			for( size_t col = 3; col--; )
				if( int8_t &coin = board[row][col]; coin == Free )
				{
					full = false;
					coin = colour;
					int needed = colour ? 3 : 0;
					bool won = board[row][0] + board[row][1] + board[row][2] == needed
							|| board[0][col] + board[1][col] + board[2][col] == needed;
					if( int mid = board[1][1]; !won && (row == col || row + col == 2) )
						won = (board[0][0] + mid + board[2][2]) == needed
							|| (board[0][2] + mid + board[2][0]) == needed;
					if( !won )
						self( colour == White ? Black : White );
					else
						++wins;
					coin = Free;
				}
		undecided += full;
	};
	recurse( White );
	cout << "wins:      " << 2 * wins << endl;
	cout << "undecided: " << 2 * undecided << endl;
}

[toc] | [prev] | [next] | [standalone]


#400595

FromJanis Papanagnou <janis_papanagnou+ng@hotmail.com>
Date2026-07-30 17:53 +0200
Message-ID<114fs2j$1blvl$1@dont-email.me>
In reply to#400593
On 2026-07-30 17:09, Bonita Montero wrote:
> As no one here shows a solution I show mine in C++23:

> [snip code]

Since your code doesn't compile without errors with my g++ -std=c++23,
and especially since you said in your OP:  "Just show the results.",
mind to post the result that your code is supposed to produce? Thanks.

Janis

[toc] | [prev] | [next] | [standalone]


#400606

FromBonita Montero <Bonita.Montero@gmail.com>
Date2026-07-30 21:59 +0200
Message-ID<114gafc$23hhe$1@raubtier-asyl.eternal-september.org>
In reply to#400595
Am 30.07.2026 um 17:53 schrieb Janis Papanagnou:

> Since your code doesn't compile without errors with my g++ -std=c++23,
> and especially since you said in your OP:  "Just show the results.",
> mind to post the result that your code is supposed to produce? Thanks.

It compiles with current MSVC, g++-14 and clang++-20.

[toc] | [prev] | [next] | [standalone]


#400614

FromJanis Papanagnou <janis_papanagnou+ng@hotmail.com>
Date2026-07-30 23:00 +0200
Message-ID<114ge1e$1blvl$2@dont-email.me>
In reply to#400606
On 2026-07-30 21:59, Bonita Montero wrote:
> Am 30.07.2026 um 17:53 schrieb Janis Papanagnou:
> 
>> Since your code doesn't compile without errors with my g++ -std=c++23,
>> and especially since you said in your OP:  "Just show the results.",
>> mind to post the result that your code is supposed to produce? Thanks.
> 
> It compiles with current MSVC, g++-14 and clang++-20.

Maybe. (I'm no MS user, so that's quite meaningless for me.)[*]

What about the actual result I had been kindly asking you to provide.

Janis

[*] In case you intend to "fix" your code here's the error messages:

$ g++ -std=c++23 -o ttt_bm ttt_bm.cc 

ttt_bm.cc: In function ‘int main()’:
ttt_bm.cc:12:25: error: expected identifier before ‘this’
    12 |     auto recurse = [&]( this auto &self, int8_t colour ) 
noexcept -> void
       |                         ^~~~
ttt_bm.cc:12:25: error: expected ‘,’ or ‘...’ before ‘this’
ttt_bm.cc: In lambda function:
ttt_bm.cc:20:28: error: ‘colour’ was not declared in this scope
    20 |                     coin = colour;
       |                            ^~~~~~
ttt_bm.cc:28:25: error: ‘self’ was not declared in this scope
    28 |                         self( colour == White ? Black : White );
       |                         ^~~~

[toc] | [prev] | [next] | [standalone]


#400621

FromPaul <nospam@needed.invalid>
Date2026-07-30 18:56 -0400
Message-ID<114gkqg$276lo$1@dont-email.me>
In reply to#400614
On Thu, 7/30/2026 5:00 PM, Janis Papanagnou wrote:
> On 2026-07-30 21:59, Bonita Montero wrote:
>> Am 30.07.2026 um 17:53 schrieb Janis Papanagnou:
>>
>>> Since your code doesn't compile without errors with my g++ -std=c++23,
>>> and especially since you said in your OP:  "Just show the results.",
>>> mind to post the result that your code is supposed to produce? Thanks.
>>
>> It compiles with current MSVC, g++-14 and clang++-20.
> 
> Maybe. (I'm no MS user, so that's quite meaningless for me.)[*]
> 
> What about the actual result I had been kindly asking you to provide.
> 
> Janis
> 
> [*] In case you intend to "fix" your code here's the error messages:
> 
> $ g++ -std=c++23 -o ttt_bm ttt_bm.cc
> ttt_bm.cc: In function ‘int main()’:
> ttt_bm.cc:12:25: error: expected identifier before ‘this’
>    12 |     auto recurse = [&]( this auto &self, int8_t colour ) noexcept -> void
>       |                         ^~~~
> ttt_bm.cc:12:25: error: expected ‘,’ or ‘...’ before ‘this’
> ttt_bm.cc: In lambda function:
> ttt_bm.cc:20:28: error: ‘colour’ was not declared in this scope
>    20 |                     coin = colour;
>       |                            ^~~~~~
> ttt_bm.cc:28:25: error: ‘self’ was not declared in this scope
>    28 |                         self( colour == White ? Black : White );
>       |                         ^~~~
> 

CoPilot gives me this.

"The errors all come from one root cause: C++23 does not support this auto &self inside a lambda.
 That syntax was proposed for “lambda recursion” but never made it into the standard.
 So g++ rejects it, and then all later errors are just fallout from the first one.
"

include <iostream>
#include <array>
#include <functional>

using namespace std;

int main()
{
    constexpr int8_t Free = -3, White = 0, Black = 1;
    array<array<int8_t, 3>, 3> board;
    board.fill( { Free, Free, Free } );
    unsigned undecided = 0, wins = 0;

    std:function<void(int8_t)> recurse;

    recurse = [&](int8_t colour)
    {
        bool full = true;
        for (size_t row = 3; row--; )
            for (size_t col = 3; col--; )
                if (int8_t &coin = board[row][col]; coin == Free)
                {
                    full = false;
                    coin = colour;

                    int needed = colour ? 3 : 0;
                    bool won = board[row][0] + board[row][1] + board[row][2] == needed
                            || board[0][col] + board[1][col] + board[2][col] == needed;

                    if (int mid = board[1][1]; !won && (row == col || row + col == 2))
                        won = (board[0][0] + mid + board[2][2]) == needed
                           || (board[0][2] + mid + board[2][0]) == needed;

                    if (!won)
                        recurse(colour == White ? Black : White);
                    else
                        ++wins;

                    coin = Free;
                }
        undecided += full;
    };

    recurse(White);

    cout << "wins:      " << 2 * wins << endl;
    cout << "undecided: " << 2 * undecided << endl;
}

bullwinkle@SKYLARK:~/Downloads$ g++ -std=c++23 -o ttt_bm ttt_bm.cc
bullwinkle@SKYLARK:~/Downloads$ ./ttt_bm
wins:      418176
undecided: 92160
bullwinkle@SKYLARK:~/Downloads$ g++ -v
...
gcc version 13.3.0 (Ubuntu 13.3.0-6ubuntu2~24.04.1)

   Paul

[toc] | [prev] | [next] | [standalone]


#400668

FromBonita Montero <Bonita.Montero@gmail.com>
Date2026-07-31 20:33 +0200
Message-ID<114ipq4$2vntg$1@raubtier-asyl.eternal-september.org>
In reply to#400621
Am 31.07.2026 um 00:56 schrieb Paul:

> CoPilot gives me this.
> 
> "The errors all come from one root cause: C++23 does not support this auto &self inside a lambda.
>   That syntax was proposed for “lambda recursion” but never made it into the standard.
>   So g++ rejects it, and then all later errors are just fallout from the first one.

I guess Copilot is wrong. Grok, Claude and GPT say it's part of the
standard. Maybe the initial compiler was too old. And it's not plausible
why this shouldn't have gone into the standard since it's simple and
useful.

[toc] | [prev] | [next] | [standalone]


#400681

From"Chris M. Thomasson" <chris.m.thomasson.1@gmail.com>
Date2026-07-31 19:53 -0700
Message-ID<114jn44$38ql9$1@dont-email.me>
In reply to#400668
On 7/31/2026 11:33 AM, Bonita Montero wrote:
> Am 31.07.2026 um 00:56 schrieb Paul:
> 
>> CoPilot gives me this.
>>
>> "The errors all come from one root cause: C++23 does not support this 
>> auto &self inside a lambda.
>>   That syntax was proposed for “lambda recursion” but never made it 
>> into the standard.
>>   So g++ rejects it, and then all later errors are just fallout from 
>> the first one.
> 
> I guess Copilot is wrong. Grok, Claude and GPT say it's part of the
> standard. Maybe the initial compiler was too old. And it's not plausible
> why this shouldn't have gone into the standard since it's simple and
> useful.

Code and research for yourself. Sigh. The AI can help make a moron sound 
half way smart?

[toc] | [prev] | [next] | [standalone]


#400652

FromMichael S <already5chosen@yahoo.com>
Date2026-07-31 17:53 +0300
Message-ID<20260731175313.00004522@yahoo.com>
In reply to#400614
On Thu, 30 Jul 2026 23:00:30 +0200
Janis Papanagnou <janis_papanagnou+ng@hotmail.com> wrote:

> On 2026-07-30 21:59, Bonita Montero wrote:
> > Am 30.07.2026 um 17:53 schrieb Janis Papanagnou:
> >   
> >> Since your code doesn't compile without errors with my g++
> >> -std=c++23, and especially since you said in your OP:  "Just show
> >> the results.", mind to post the result that your code is supposed
> >> to produce? Thanks.  
> > 
> > It compiles with current MSVC, g++-14 and clang++-20.  
> 
> Maybe. (I'm no MS user, so that's quite meaningless for me.)[*]
> 

gcc-14 and clang-20 are certainly available on many (most ?) Linux
distributions. May be, getting them on some distros is less easy than
it is on Windows/msys2, but it is not a rocket science.

[toc] | [prev] | [next] | [standalone]


#400661

FromJanis Papanagnou <janis_papanagnou+ng@hotmail.com>
Date2026-07-31 18:17 +0200
Message-ID<114ihrn$1blvl$3@dont-email.me>
In reply to#400652
On 2026-07-31 16:53, Michael S wrote:
> On Thu, 30 Jul 2026 23:00:30 +0200
> Janis Papanagnou <janis_papanagnou+ng@hotmail.com> wrote:
> 
>> On 2026-07-30 21:59, Bonita Montero wrote:
>>> Am 30.07.2026 um 17:53 schrieb Janis Papanagnou:
>>>    
>>>> Since your code doesn't compile without errors with my g++
>>>> -std=c++23, and especially since you said in your OP:  "Just show
>>>> the results.", mind to post the result that your code is supposed
>>>> to produce? Thanks.
>>>
>>> It compiles with current MSVC, g++-14 and clang++-20.
>>
>> Maybe. (I'm no MS user, so that's quite meaningless for me.)[*]
> 
> gcc-14 and clang-20 are certainly available on many (most ?) Linux
> distributions. May be, getting them on some distros is less easy than
> it is on Windows/msys2, but it is not a rocket science.

Availability of the GNU CC on Linux was not the problem with BM's code.
See Paul's reply for details.

Janis

[toc] | [prev] | [next] | [standalone]


#400696

FromMichael S <already5chosen@yahoo.com>
Date2026-08-01 21:44 +0300
Message-ID<20260801214405.00002284@yahoo.com>
In reply to#400661
On Fri, 31 Jul 2026 18:17:58 +0200
Janis Papanagnou <janis_papanagnou+ng@hotmail.com> wrote:

> On 2026-07-31 16:53, Michael S wrote:
> > On Thu, 30 Jul 2026 23:00:30 +0200
> > Janis Papanagnou <janis_papanagnou+ng@hotmail.com> wrote:
> >   
> >> On 2026-07-30 21:59, Bonita Montero wrote:  
> >>> Am 30.07.2026 um 17:53 schrieb Janis Papanagnou:
> >>>      
> >>>> Since your code doesn't compile without errors with my g++
> >>>> -std=c++23, and especially since you said in your OP:  "Just show
> >>>> the results.", mind to post the result that your code is supposed
> >>>> to produce? Thanks.  
> >>>
> >>> It compiles with current MSVC, g++-14 and clang++-20.  
> >>
> >> Maybe. (I'm no MS user, so that's quite meaningless for me.)[*]  
> > 
> > gcc-14 and clang-20 are certainly available on many (most ?) Linux
> > distributions. May be, getting them on some distros is less easy
> > than it is on Windows/msys2, but it is not a rocket science.  
> 
> Availability of the GNU CC on Linux was not the problem with BM's
> code. See Paul's reply for details.
> 
> Janis
> 

It was, actually. Not on any Linux, but on your specific Linux
instalation.
Bonita said that her code compiles with gcc-14. I see no reason
to not believe her.

BTW, it was not Paul's reply, but reply of co-pilot. Which I don't
trust.

[toc] | [prev] | [next] | [standalone]


#400697

FromJanis Papanagnou <janis_papanagnou+ng@hotmail.com>
Date2026-08-01 21:43 +0200
Message-ID<114li8e$1bcir$1@dont-email.me>
In reply to#400696
On 2026-08-01 20:44, Michael S wrote:
> [...]
> Bonita said that her code compiles with gcc-14. [..]

What she originally said was: "I show mine in C++23".

And I did:  g++ -std=c++23 -o ttt_bm ttt_bm.cc
and got errors.

> BTW, it was not Paul's reply, but reply of co-pilot. [...]

The point is that BM's code didn't compile with -std=c++23
and Paul's code - that fixes the issue - compiled well.

All that wouldn't have been necessary in the first place if
Bonita would have just shown her results - as she requested
also from the audience! - but no, not even after I asked for
that, twice.

Paul's response (with or without AI) was helpful - in *both*
respects, code and result! - Bonita's (and yours) were not.

(You can continue squirming around these obvious facts, but
don't expect that I'll respond to more useless rubbish like
that.)

Janis

BTW, providing some code is hardly evidence for the original
question. A formal mathematical deduction would be in order
to get any results to be verified. - Otherwise you can only
compare all programs' results and make guesses (or ask an AI -
which might be okay given that this is such a trivial "quest"
that had certainly be "solved" many times in every language,
so easily to be identified by the AIs - I've just tested that
and got code, code that compiles correctly and that produces
the equivalent results, modulo the symmetries, of course).

[toc] | [prev] | [next] | [standalone]


#400600

From"Mr. Man-wai Chang" <toylet.toylet@gmail.com>
Date2026-07-31 00:45 +0800
Message-ID<114fv3s$1v2v7$2@toylet.eternal-september.org>
In reply to#400519
On 7/29/2026 8:10 PM, Bonita Montero wrote:
> Write a program that calculates the number of possible ways to
> win a Tic Tac Toe round and the number of possible undecided
> rounds. Don't show the code here immediately but after some
> days. Just show the results.
> C and C++ are allowed since the solution will be very similar.

Possibly a very famous assignment for students
doing computer science. But I have never ever
written a game.

-- 

    @~@   Simplicity is Beauty! Remain silent! Drink, Blink, Stretch!
   / v \  May the Force and farces be with you! Live long and prosper!!
  /( _ )\ https://sites.google.com/site/changmw/
    ^ ^   https://github.com/changmw/changmw
          The game is afoot... Meow...

[toc] | [prev] | [next] | [standalone]


#400607

FromBonita Montero <Bonita.Montero@gmail.com>
Date2026-07-30 22:00 +0200
Message-ID<114gagq$23hhe$2@raubtier-asyl.eternal-september.org>
In reply to#400600
Am 30.07.2026 um 18:45 schrieb Mr. Man-wai Chang:
> On 7/29/2026 8:10 PM, Bonita Montero wrote:
>> Write a program that calculates the number of possible ways to
>> win a Tic Tac Toe round and the number of possible undecided
>> rounds. Don't show the code here immediately but after some
>> days. Just show the results.
>> C and C++ are allowed since the solution will be very similar.
> 
> Possibly a very famous assignment for students
> doing computer science. But I have never ever
> written a game.

It's not about writing a game but calculating the likhehood
of different outcomes.

[toc] | [prev] | [next] | [standalone]


#400630

From"Mr. Man-wai Chang" <toylet.toylet@gmail.com>
Date2026-07-31 13:29 +0800
Message-ID<114hbsf$2docc$3@toylet.eternal-september.org>
In reply to#400607
On 7/31/2026 4:00 AM, Bonita Montero wrote:
> Am 30.07.2026 um 18:45 schrieb Mr. Man-wai Chang:
>> On 7/29/2026 8:10 PM, Bonita Montero wrote:
>>> Write a program that calculates the number of possible ways to
>>> win a Tic Tac Toe round and the number of possible undecided
>>> rounds. Don't show the code here immediately but after some
>>> days. Just show the results.
>>
>> Possibly a very famous assignment for students
>> doing computer science. But I have never ever
>> written a game.
> 
> It's not about writing a game but calculating the likhehood
> of different outcomes.


But do you have to use beautiful maths to
solve maths problems? Could we just use
fingers and counting, like programming? :)

-- 

    @~@   Simplicity is Beauty! Remain silent! Drink, Blink, Stretch!
   / v \  May the Force and farces be with you! Live long and prosper!!
  /( _ )\ https://sites.google.com/site/changmw/
    ^ ^   https://github.com/changmw/changmw
          The game is afoot... Meow...

[toc] | [prev] | [next] | [standalone]


#400633

FromJohann 'Myrkraverk' Oskarsson <johann@myrkraverk.invalid>
Date2026-07-31 14:54 +0800
Message-ID<REXaS.56468$aXr.12098@fx18.ams4>
In reply to#400630
On 31/07/2026 1:29 PM, Mr. Man-wai Chang wrote:
> On 7/31/2026 4:00 AM, Bonita Montero wrote:
>> Am 30.07.2026 um 18:45 schrieb Mr. Man-wai Chang:
>>> On 7/29/2026 8:10 PM, Bonita Montero wrote:
>>>> Write a program that calculates the number of possible ways to
>>>> win a Tic Tac Toe round and the number of possible undecided
>>>> rounds. Don't show the code here immediately but after some
>>>> days. Just show the results.
>>>
>>> Possibly a very famous assignment for students
>>> doing computer science. But I have never ever
>>> written a game.
>>
>> It's not about writing a game but calculating the likhehood
>> of different outcomes.
> 
> 
> But do you have to use beautiful maths to
> solve maths problems? Could we just use
> fingers and counting, like programming? :)
> 

There is a game called "lights out."  I forgot the exact rules, but
it has lights on a grid, and toggling one toggles four others in a
cross pattern[1].  Some squares -- it depends on the size -- you can
solve exactly, and some have no solutions.  The "trick" here is to
create a program that does boolean matrix algebra, and then it can
tell you if the current board/position has a solution, or has no
solution.

The object of the game is to start with all lights on, and then turn
them all off.

Do you like to create programs that solve such games?


[1] Dan Cross need not reply.  Nor Keith, he can't code his own boolean
matrices anyway.

-- 
Johann | email: invalid -> com | http://www.myrkraverk.com/blog/
I'm not from the Internet, I just work there. | via Easynews.com

[toc] | [prev] | [next] | [standalone]


#400636

FromKeith Thompson <Keith.S.Thompson+u@gmail.com>
Date2026-07-31 03:00 -0700
Message-ID<114hrne$2jldf$1@kst.eternal-september.org>
In reply to#400633
Johann 'Myrkraverk' Oskarsson <johann@myrkraverk.invalid> writes:
[...]
> [1] Dan Cross need not reply.  Nor Keith, he can't code his own boolean
> matrices anyway.

Your apparent obsession with me is annoying.  I intend this to be
my last communication with you.  Please consider not mentioning
me ever again.  (If you could refrain from making off-topic posts
to these newsgroups, that would be great, but I don't expect that
kind of self-control.)

-- 
Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
void Void(void) { Void(); } /* The recursive call of the void */

[toc] | [prev] | [next] | [standalone]


#400641

FromJohann 'Myrkraverk' Oskarsson <johann@myrkraverk.invalid>
Date2026-07-31 20:57 +0800
Message-ID<WY0bS.4293$ZjVb.505@fx12.ams4>
In reply to#400636
On 31/07/2026 6:00 PM, Keith Thompson wrote:
> Johann 'Myrkraverk' Oskarsson <johann@myrkraverk.invalid> writes:
> [...]
>> [1] Dan Cross need not reply.  Nor Keith, he can't code his own boolean
>> matrices anyway.
> 
> Your apparent obsession with me is annoying.  I intend this to be
> my last communication with you.  Please consider not mentioning
> me ever again.  (If you could refrain from making off-topic posts
> to these newsgroups, that would be great, but I don't expect that
> kind of self-control.)
> 

You broke your own rule, and replied to me.  Do you have amnesia?

-- 
Johann | email: invalid -> com | http://www.myrkraverk.com/blog/
I'm not from the Internet, I just work there. | via Easynews.com

[toc] | [prev] | [next] | [standalone]


#400643

Fromgazelle@shell.xmission.com (Kenny McCormack)
Date2026-07-31 14:08 +0000
Message-ID<114ia9o$cako$1@news.xmission.com>
In reply to#400636
In article <114hrne$2jldf$1@kst.eternal-september.org>,
Keith Thompson  <Keith.S.Thompson+u@gmail.com> wrote:
>Johann 'Myrkraverk' Oskarsson <johann@myrkraverk.invalid> writes:
>[...]
>> [1] Dan Cross need not reply.  Nor Keith, he can't code his own boolean
>> matrices anyway.
>
>Your apparent obsession with me is annoying.  I intend this to be
>my last communication with you.  Please consider not mentioning
>me ever again.  (If you could refrain from making off-topic posts
>to these newsgroups, that would be great, but I don't expect that
>kind of self-control.)

The Lord & Master has spoken.

-- 
The last time a Republican cared about you, you were a fetus.

[toc] | [prev] | [next] | [standalone]


Page 3 of 5 — ← Prev page 1 2 [3] 4 5  Next page →

Back to top | Article view | comp.lang.c


csiph-web