Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Is it possible that?
#1
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?
Reply
#2
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
b = b + ...
Reply
#3
(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.
Reply
#4
Is same as Color 15, 0

Where did you get that code from anyway?
b = b + ...
Reply
#5
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 "
Tread on those who tread on you

Reply
#6
(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.
Reply
#7
(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).
New to QB64pe? Visit the QB64 tutorial to get started.
QB64 Tutorial
Reply
#8
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
Shoot first and shoot people who ask questions, later.
Reply
#9
mod time
Reply
#10
(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
Reply




Users browsing this thread: 2 Guest(s)