QB64 Phoenix Edition
A next exercise . . . - Printable Version

+- QB64 Phoenix Edition (https://staging.qb64phoenix.com)
+-- Forum: Chatting and Socializing (https://staging.qb64phoenix.com/forumdisplay.php?fid=11)
+--- Forum: General Discussion (https://staging.qb64phoenix.com/forumdisplay.php?fid=2)
+--- Thread: A next exercise . . . (/showthread.php?tid=1890)

Pages: 1 2


A next exercise . . . - Kernelpanic - 08-11-2023

Nothing is going on here anymore. Dance of Death, or what? There is more going on at 12 o'clock at night in a Berlin cemetery than here.  Tongue Maybe it needs a new job. . .

There are nine points arranged in a square. The task is to connect these 9 points with four, and only four straight lines - without lifting the pen from the paper. What do the four lines look like?

[Image: Neun-Punkte.jpg]


RE: A next exercise . . . - bplus - 08-11-2023

I can do it in 3!


RE: A next exercise . . . - CharlieJV - 08-11-2023

(08-11-2023, 11:05 PM)Kernelpanic Wrote: Nothing is going on here anymore. Dance of Death, or what? There is more going on at 12 o'clock at night in a Berlin cemetery than here.  Tongue Maybe it needs a new job. . .

There are nine points arranged in a square. The task is to connect these 9 points with four, and only four straight lines - without lifting the pen from the paper. What do the four lines look like?

[Image: Neun-Punkte.jpg]

Got it in four.  Had to walk away and not actively think about it, as in let the subconscious hamster spinning in the hamster wheel way back in my sponge to the magic.

Then, out of nowhere, I think the hamster died, but the wheel kept spinning, and voilà, there it was.

That was fun.  Not bad for a burnt-out older fella at the end of a hard work week.  Huh...


RE: A next exercise . . . - SMcNeill - 08-11-2023

Top, left to right -- extend past to an imaginary 4th dot.
Diagonal left/down to imaginary 4th dot.
Up to top left dot.
Diagonal right/down to 9th dot.

(Assume dots only take up portion of page and you have extra to work with.)


RE: A next exercise . . . - SMcNeill - 08-11-2023

Option 2: Roll the paper so all dots align.  Make 1 line with permanent marker; let it bleed through to cover them all.


RE: A next exercise . . . - bplus - 08-12-2023

I am lazy and will only do it in 3 lines:
Code: (Select All)
Screen _NewImage(1000, 300, 32)
_ScreenMove 100, 200
For y = 0 To 2
    For x = 0 To 2
        Circle (x * 100 + 400, y * 100 + 50), 30
    Next
Next
a = _Atan2(60, 200)
x = 60 / Sin(a)
adj = 50
Line (350, 50)-(600 + x + adj, 50)
Line (600 + x + adj, 50)-(400 - x - adj, 250)
Line (400 - x - adj, 250)-(650, 250)
Sleep

The smaller the circles the longer the lines


RE: A next exercise . . . - SMcNeill - 08-12-2023

I can do it with one dot.  Nobody ever mentioned how WIDE the line was!  The center line on the highway would certainly cover all those dots!  Wink


RE: A next exercise . . . - CharlieJV - 08-12-2023

Ah hell.  I drew the letter E and I thought I had done pretty well.  Meh.


RE: A next exercise . . . - bplus - 08-12-2023

(08-12-2023, 12:56 AM)SMcNeill Wrote: I can do it with one dot.  Nobody ever mentioned how WIDE the line was!  The center line on the highway would certainly cover all those dots!  Wink

Oh man! what a solution, I luv it! Just use a really, really, really big pencil LOL


RE: A next exercise . . . - SMcNeill - 08-12-2023

(08-12-2023, 01:03 PM)bplus Wrote:
(08-12-2023, 12:56 AM)SMcNeill Wrote: I can do it with one dot.  Nobody ever mentioned how WIDE the line was!  The center line on the highway would certainly cover all those dots!  Wink

Oh man! what a solution, I luv it! Just use a really, really, really big pencil LOL

But here's my actual solution, which I think is what we're looking for here:

Code: (Select All)
SCREEN _NEWIMAGE(1000, 400, 32)
_SCREENMOVE _MIDDLE
FOR y = 0 TO 2: FOR x = 0 TO 2
        CIRCLE (x * 100 + 400, y * 100 + 50), 3
NEXT x, y
LINE (400, 50)-STEP(300, 0)
LINE -(400, 350)
LINE -STEP(0, -300)
LINE -STEP(200, 200)
SLEEP

Unlike yours, or my other suggestions, this doesn't require the circle (or the line) to be any larger than a single pixel/point to work.  I've only got this set to a size 3 circle so that the dots stand out and are recognizable for us.  They don't have to be so large as to allow bisecting them at top/middle/bottom like your solution does.  Wink