Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Boxing accident
#1
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
Reply
#2
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
Reply
#3
@james d jarvis

This is cool, thanks for sharing.

Here is what it looks like folks.


[Image: boxing-accident.png]
grymmjack (gj!)
GitHubYouTube | Soundcloud | 16colo.rs
Reply
#4
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.
Reply
#5
I had forgotten about this post. Amazing how fast 2 years can zip past.
Reply
#6
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
Reply
#7
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
Reply
#8
Big Grin Big Grin Big Grin
Reply




Users browsing this thread: 5 Guest(s)