QB64 Phoenix Edition
Boxing accident - Printable Version

+- QB64 Phoenix Edition (https://qb64phoenix.com/forum)
+-- Forum: QB64 Rising (https://qb64phoenix.com/forum/forumdisplay.php?fid=1)
+--- Forum: Code and Stuff (https://qb64phoenix.com/forum/forumdisplay.php?fid=3)
+---- Forum: Programs (https://qb64phoenix.com/forum/forumdisplay.php?fid=7)
+---- Thread: Boxing accident (/showthread.php?tid=409)



Boxing accident - James D Jarvis - 05-14-2022

So writing a sub to draw rectangles with line thickness and the first one I knocked out revealed a curious and happy surprise:


Code: (Select All)
'Boxing accident
Screen _NewImage(800, 500, 32)
Dim Shared pencolor As _Unsigned Long
pencolor = _RGB32(250, 250, 250)

box 2, 2, 140, 80, 3, &HFFFFFFFF

box 152, 2, 250, 100, 3, &HFF

box 300, 2, 400, 200, 9, &HF0F0F0F

box 30, 200, 90, 400, 20, &HF00F00F

Locate 20, 20: Print "A happy accident using line styles"
Locate 21, 20: Print "and a simple algorithm"
Sub box (x1, y1, x2, y2, thickness, style)
    xa = x1: xb = x2: ya = y1: yb = y2
    For l = 1 To thickness
        Line (xa, ya)-(xb, yb), pencolor, B , style
        xa = xa + 1: xb = xb - 1
        ya = ya + 1: yb = yb - 1
    Next l
End Sub



RE: Boxing accident - Pete - 07-03-2024

Oh well, it's like computer programmer Mike Tyson once said... "Every box coder has a plan until they get a punch card in the face!"

Pete


RE: Boxing accident - grymmjack - 07-04-2024

@james d jarvis

This is cool, thanks for sharing.

Here is what it looks like folks.


[Image: boxing-accident.png]


RE: Boxing accident - Pete - 07-04-2024

I like the last one the best.

This coding "accident" reminded me of the time Steve stumbled on inventing sentient A.I.

> Do you know who I am? (Steve's question.)

> Steve. (App reply.) Now this could be a coincidence.

> Steve is the smartest person I know. (App reply.) Now this proves it is intelligent.

> Steve is the only person I know. (App reply.) Now this proves it is sentient, and hilarious.

Pete


- The difference between A.I. and humans is humans try to re-write history; A.I. will simply reboot it.


RE: Boxing accident - James D Jarvis - 07-17-2024

I had forgotten about this post. Amazing how fast 2 years can zip past.


RE: Boxing accident - Pete - 07-17-2024

Well two years goes by pretty darn slowly when we're all waiting around for the next version! When in the hell will Boxing 2.0 be released!? Big Grin 

 - Hint: The reply should be something akin to: Waiting for the weather in Hell to cool down a bit, first.

Pete


RE: Boxing accident - James D Jarvis - 07-17-2024

I had a candy cane trim on some goofy program I shared with my kid a couple year ago. I suppose that was box 1.5


RE: Boxing accident - Pete - 07-17-2024

Big Grin Big Grin Big Grin