News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

how to change background color of static control, and add text - resolved

Started by quarantined, August 14, 2022, 05:44:08 AM

Previous topic - Next topic

jj2007

Quote from: swordfish on September 02, 2022, 12:19:33 PM
Quote from: NoCforMe on September 02, 2022, 11:20:31 AM
Instead of a big ol' "O" I get two thin vertical lines. Missing bitmap or something?
Yes program uses "Segoe UI Emoji" font.  :rolleyes:

Indeed, but that works fine on both Win7-64 and my standard Win10 installation - see below. Strange :rolleyes:

QuoteI guess I'll have to hurry and finish my Tic Tac Toe game.  :biggrin:

Yessss :thumbsup:

TimoVJL

May the source be with you

hutch--

JJ,

What have you zipped that file with, neither Slimjet or Chrome download a valid zip file.

jj2007

Quote from: TimoVJL on September 02, 2022, 07:13:25 PM
"Segoe UI Emoji" comes within MS office packages ?

Segoe UI Emoji font family

That would explain something; however, on my Win10 machine I don't have the Office package. But I routinely install the free MS Word viewer to make my RichEdit controls 20x faster, so that could be the reason why it works for me.

Quote from: hutch-- on September 02, 2022, 07:38:42 PM
What have you zipped that file with, neither Slimjet or Chrome download a valid zip file.

Works fine here, on two machines. You had the same problem some weeks ago - might be related to Australia being distant?

jj2007


hutch--

I solved it, it was a PNG file with a ZIP extension. My Winrar would not open it as it was not an archive file.

jj2007

P#1 P#2
r0c0 r2c2
r0c2 r0c1
r2c0 r1c0
r1c1 player won


Does anybody know a sequence that allows player #2 to win?

hutch--

I codee the last game of this type back in the early 90s so I am a bit rusty here but from memory the options are deterministic and exhaustive. If it uses a logic where each of the 9 squares can be turned on but not off with either a nought or cross, then the testing can only be one of a limited number of combinations. Whoever makes the first move has the advantage but the second player can always force a draw.

Effectively, 8 combinations for either noughts or crosses so only 16 checks of 3 locations to determine a winner or a draw.

zedd151

Quote from: jj2007 on September 02, 2022, 09:58:38 PM
P#1   P#2
r0c0   r2c2
r0c2   r0c1
r2c0   r1c0
r1c1   player won


Does anybody know a sequence that allows player #2 to win?
If P#1 first and second move are on a diagonal and P#1 third move is perpendicular to both his first and second moves, P#1 always wins, regardless of what blocking moves P#2 makes...since there exist more than one place where P#1 can win after P#1s third move, and P#2's second move. (More than one blocking move)

Its known in scientific circles as "The Tic Tac Toe Paradox"TM   :tongue:

Unless P#2 cheats of course.  :badgrin:

zedd151

More concise explanation. If P1 first three moves are on 3 corners of the grid, by this time there are two places he can win (after P2's first two moves). No matter which corners P1's pieces are in, and regardless of P2's moves.


So therefore it is a great advantage of being the first player in a round. So maybe winner plays next game first, is not a very good idea (at least from losing players perspective)


So maybe the starting player for each round should alternate regardless who won previous round? Then actually the game is pointless, if both players know what 'best moves' to make for their first three moves. First player would always win in that scenario - no matter which side plays first.


But still makes a good coding exercise.
Edited for clarity and articulation.  :biggrin:

zedd151

I just found out something funny. When I was playing around with static controls here, there was one time where I created a static control in a window, but the static control did not appear in the window. I spent a good half hour or more, scrutinizing the code and running it in olly.


Earlier today I had a similar issue. I was floored when I found out the cause....


I had forgotten I had 'or SS_BITMAP' in the window style. Apparently the static is created with a transparent background in that instance or same color as main window.  :rolleyes:  Oops.

NoCforMe

Assembly language programming should be fun. That's why I do it.