Disabling autostretch (or the DPI awareness switch) resolved the issue; being able to see what I'm doing I managed to score... 258! I'm clearly better off with my eyes shut.

Nice, thanks for posting.
Code: Select all
For i=1 To 16
nb$=Str(nb)
;StartDrawing(ScreenOutput())
CreateSprite(i, zoom/4,zoom/4)
StartDrawing(SpriteOutput(i))
DrawingMode(1)
Box(0,0,zoom/4-1,zoom/4-1,RGB(188,188,188))
For y=4 To zoom/4-6
For x=4 To zoom/4-6
Plot(x,y,RGB(SPH(1,i)+Random(x/2),SPH(2,i)+Random(y/2),SPH(3,i)+Random((x+y)/3)))
Next
Next
DrawingFont(Police)
DrawText(zoom/8-TextWidth(nb$)/2,zoom/8-TextHeight(nb$)/2, nb$, RGB(255,255,255))
StopDrawing()
;GrabSprite(i,0,0,zoom/4,zoom/4)
nb*2
Next
Code: Select all
Police = LoadFont(0, "ubuntu", 24);zoom/25)
Police2 = LoadFont(1, "terminal", zoom/70)
Police3 = LoadFont(2, "terminal", zoom/23)
Police4 = LoadFont(3, "terminal", zoom/12)
Debug IsFont(0)
Debug Police
Thank you very much for this correction. If it's okay with everyone, I'll correct my code with your routines.#NULL wrote: Thu May 15, 2025 8:04 am On linux something doesn't work with the GrabSprite(). When I use CreateSprite() instead, I can see the numbered squares:
(around line number ~51)Code: Select all
For i=1 To 16 nb$=Str(nb) ;StartDrawing(ScreenOutput()) CreateSprite(i, zoom/4,zoom/4) StartDrawing(SpriteOutput(i)) DrawingMode(1) Box(0,0,zoom/4-1,zoom/4-1,RGB(188,188,188)) For y=4 To zoom/4-6 For x=4 To zoom/4-6 Plot(x,y,RGB(SPH(1,i)+Random(x/2),SPH(2,i)+Random(y/2),SPH(3,i)+Random((x+y)/3))) Next Next DrawingFont(Police) DrawText(zoom/8-TextWidth(nb$)/2,zoom/8-TextHeight(nb$)/2, nb$, RGB(255,255,255)) StopDrawing() ;GrabSprite(i,0,0,zoom/4,zoom/4) nb*2 Next
Code: Select all
ExamineDesktops()
OpenWindow(0,0,0,DesktopUnscaledX(zoom),DesktopUnscaledY(zoom+zoom/10),"Magic 4x4",#PB_Window_ScreenCentered);|#PB_Window_SystemMenu)
The goal of the game is to add two identical numbers by pressing them together using the arrow keys on your keyboard.BarryG wrote: Thu May 15, 2025 11:27 am I have no idea how to play this or what to do. The "instructions" on line 5 don't explain jack.
It's just a reboot of 2048 game :BarryG wrote: Thu May 15, 2025 11:27 am I have no idea how to play this or what to do. The "instructions" on line 5 don't explain jack.
Are you sure it adds two pieces even if the chosen direction doesn't move any pieces?NicTheQuick wrote: Thu May 15, 2025 2:13 pm Version 1.1c works now. But I think there is a bug. If you move into a direction that does not change the field, there still will be added two new pieces. Therefore I think if there is a direction that does not change the field no new pieces should be added.
Yes, sorry for that. The original one on a 5x5 grid usually adds 2 pieces. I just confused it with yours. Your code only adds one piece.SPH wrote: Thu May 15, 2025 3:28 pmAre you sure it adds two pieces even if the chosen direction doesn't move any pieces?NicTheQuick wrote: Thu May 15, 2025 2:13 pm Version 1.1c works now. But I think there is a bug. If you move into a direction that does not change the field, there still will be added two new pieces. Therefore I think if there is a direction that does not change the field no new pieces should be added.
I coded the game so that it only adds one piece. I'm sure of it. To convince yourself, take a screenshot before and after a turn and look closely...
By the way: I'm amazed by your score! GG