QB64 Phoenix Edition
Is it possible that? - Printable Version

+- QB64 Phoenix Edition (https://qb64phoenix.com/forum)
+-- Forum: Chatting and Socializing (https://qb64phoenix.com/forum/forumdisplay.php?fid=11)
+--- Forum: General Discussion (https://qb64phoenix.com/forum/forumdisplay.php?fid=2)
+--- Thread: Is it possible that? (/showthread.php?tid=2447)

Pages: 1 2


Is it possible that? - gaslouk - 02-14-2024

SCREEN 13
COLOR 6 * 2 + 3, 0 - 5 + 8 * 2 - 11
CLS
FOR I = 0 TO 70 STEP 0.1
    PSET (I * COS(I) + 140, 20 - I * (SIN(I) * 0.2 - 2))
NEXT
LINE (136, 20)-(140, 12)
LINE -(144, 20): LINE -(134, 16)
LINE -(146, 16): LINE -(136, 20)
A$ = INPUT$(1)

Is this really possible?


RE: It is possible that? - bplus - 02-14-2024

Not this?
Code: (Select All)
Screen 13
Color 2
PSet (140 + Cos(0), 20)
For I = 0 To 70 Step 0.1
    Line -(I * Cos(I) + 140, 20 - I * (Sin(I) * 0.2 - 2))
Next
Color 14
Line (136, 20)-(140, 12)
Line -(144, 20): Line -(134, 16)
Line -(146, 16): Line -(136, 20)
A$ = Input$(1)

Big Grin


RE: It is possible that? - gaslouk - 02-14-2024

(02-14-2024, 02:17 PM)gaslouk Wrote: SCREEN 13
COLOR 6 * 2 + 3, 0 - 5 + 8 * 2 - 11
CLS
FOR I = 0 TO 70 STEP 0.1
    PSET (I * COS(I) + 140, 20 - I * (SIN(I) * 0.2 - 2))
NEXT
LINE (136, 20)-(140, 12)
LINE -(144, 20): LINE -(134, 16)
LINE -(146, 16): LINE -(136, 20)
A$ = INPUT$(1)

Is this really possible?

(02-14-2024, 02:36 PM)bplus Wrote: Not this?
Code: (Select All)
Screen 13
Color 2
PSet (140 + Cos(0), 20)
For I = 0 To 70 Step 0.1
    Line -(I * Cos(I) + 140, 20 - I * (Sin(I) * 0.2 - 2))
Next
Color 14
Line (136, 20)-(140, 12)
Line -(144, 20): Line -(134, 16)
Line -(146, 16): Line -(136, 20)
A$ = Input$(1)

Big Grin

I mean this

COLOR 6 * 2 + 3, 0 - 5 + 8 * 2 - 11 

How this is really possible.


RE: Is it possible that? - bplus - 02-14-2024

Is same as Color 15, 0

Where did you get that code from anyway?


RE: Is it possible that? - SpriggsySpriggs - 02-14-2024

Gaslouk, they're just obscuring the data passed to COLOR to make it look like they're doing something neat. See what QB64 gives you if you do "PRINT  6 * 2 + 3, 0 - 5 + 8 * 2 - 11 "


RE: Is it possible that? - gaslouk - 02-14-2024

(02-14-2024, 04:16 PM)SpriggsySpriggs Wrote: Gaslouk, they're just obscuring the data passed to COLOR to make it look like they're doing something neat. See what QB64 gives you if you do "PRINT  6 * 2 + 3, 0 - 5 + 8 * 2 - 11 "
Ηι

In how many basic can you do this? I didn't see it in anyone's program, I just stumbled upon this little MSXbasic program trying to run it on QB64. After modification of course. And the same thing happens the "screen". SCREEN 16-4"

That's why I asked.


RE: Is it possible that? - TerryRitchie - 02-14-2024

(02-14-2024, 06:52 PM)gaslouk Wrote:
(02-14-2024, 04:16 PM)SpriggsySpriggs Wrote: Gaslouk, they're just obscuring the data passed to COLOR to make it look like they're doing something neat. See what QB64 gives you if you do "PRINT  6 * 2 + 3, 0 - 5 + 8 * 2 - 11 "
Ηι

In how many basic can you do this? I didn't see it in anyone's program, I just stumbled upon this little MSXbasic program trying to run it on QB64. After modification of course. And the same thing happens the "screen". SCREEN 16-4"

That's why I asked.
There's nothing mysterious going on here. Instead of hard coding numeric values like so:

COLOR 15, 0

Or using variables:

Fcolor = 15
Bcolor = 0
COLOR Fcolor, Bcolor

The code you came across forced BASIC to do a little math first:

COLOR 6 * 2 + 3, 0 - 5 + 8 * 2 - 11

Six times two = 12 plus three = 15

Eight times two = 16 plus zero = 16 minus five = 11 minus eleven = 0

So there's your two numbers 15, 0

You can place math statements like this in all versions of BASIC, although using this style of coding without including a variable or two is strange. My guess is the programmer that wrote this code wanted to make the code look more exotic or make him/herself look like some sort of guru programmer (but failed miserably).


RE: Is it possible that? - Pete - 02-15-2024

Thanks for the inspiration. I now discovered the unified field theory. Sorry Bill, beat you to it again, as usual...

SCREEN 5 + 3 - 4 * 2

The only screen anyone needs!

Pete


RE: Is it possible that? - vince - 02-16-2024

mod time



RE: Is it possible that? - Kernelpanic - 02-16-2024

(02-15-2024, 05:39 AM)Pete Wrote: Thanks for the inspiration. I now discovered the unified field theory. Sorry Bill, beat you to it again, as usual...

SCREEN 5 + 3 - 4 * 2

The only screen anyone needs!

Pete
And I was afraid that he had lost his sharp mind.
Clearly: 5 + 3 - 4 * 2. That is: 3 - 4 = -1 + 5 = 4 and 4 * 2 = 8. So screen 8!  Big Grin

Not everyone understands that!  Cool