The Amazing Screen Saver

Community Forums/Showcase/The Amazing Screen Saver

Techlord(Posted 2004) [#1]
Graphics 800,600,16,1
WaitKey()



GfK(Posted 2004) [#2]
Thats just shoddy.

You aren't even checking to see if the graphics card is capable of 800x600x16.

F- "Must try harder"
:)


sswift(Posted 2004) [#3]
And when he goes to the control panel, the screensaver will come up and wait for a key because of the call made for the preview window.


pantsonhead.com(Posted 2004) [#4]
I think you over-optimized the code - this screensaver doesn't respond to my mouseclicks. ;)


ckob(Posted 2004) [#5]
Graphics 800,600,16,1
WaitKey()
waitmouse()


had to do that to get it to exit when i hit my mouse :P


Hansie(Posted 2004) [#6]
Could you compile this so it doesn't give errors such as "buffer full" in my IDE?


Rimmsy(Posted 2004) [#7]
I think it's good. Screenshot in the gallery, anyone?


slenkar(Posted 2004) [#8]
This is bloatware


sswift(Posted 2004) [#9]
ckob:
Both waitkey AND waitmouse? Then you have to hit a key AND move the mouse before the screensaver shuts down.

Here's a PROPER minimalist screensaver:


If Upper$(CommandLine$()) = "/S"
Graphics 640,480
Repeat
For Key = 0 To 255 : If KeyHit(Key) Then End
Next
Until GetMouse() Or MouseXSpeed() Or MouseYSpeed()
EndIf


It's interesting to note that if you try to put the "next" after a colon after the "end" in the if statement, then Blitz will give an error that there is a next without a for... Almost as if everything after an If Then pair seperated by colons will be executed without the need for an EndIf. That seems like strange behavior to me, probably has led to a lot of bugs for people who like to seperate things with colons.

(I never use colon except when trying to make my code intentionally obfusticated or when trying to use as few lines as possible.)


Elf(Posted 2004) [#10]
Sswift,

Interesting comment about the colons. I've always understood in other BASICs that colons form a compound statement, so I would expect the behaviour you described..

Effectively:

Repeat
For Key = 0 to 255 : If KeyHit(Key) Then End : Next
Until <Blah>


Is the same as:

Repeat
For Key = 0 to 255
  If KeyHit(Key) Then
    End
    Next
  Endif
Until <Blah>


..so I would expect Blitz's error.


Incidentally, I don't use colons either - I reckon it makes the code unreadable!


Filax(Posted 2004) [#11]
Lol :)


Grisu(Posted 2004) [#12]
I have an even shorter screensaver ;)

[Code]
*turns monitor off*
[/Code]


Michael Reitzenstein(Posted 2004) [#13]
Surely you jest, for if your monitor wasn't on then you wouldn't have been able to post?


jhocking(Posted 2004) [#14]
i R 733t haxorz!

EDIT: Sorry, I was typing with my monitor off.


sswift(Posted 2004) [#15]
"Interesting comment about the colons. I've always understood in other BASICs that colons form a compound statement"

I think that is unintuitive. I understood them to be line breaks. One does not look at an if statement and think "If that is true, then execute everthing on the line after this."

What if I do this?

If A = 5 B = 10 : C = 11
D = 12
EndIf

Will that work? I don't know. Hell, having a Then doesn't even mean that it's a one line statement in Blitz does it?

Doing a little investigating I find that the above will not work. The way IF works in Blitz is if there is anything on the line after the if condition, (other than a comment) it does not look for additional statements on the next few lines, and it does not look for an endif. So an endif there would generate an error.

Personally, I think that : should be a line break, and you should only be allowed to have "then" when there is only one statement on the line after the IF. If you want to have multiple commands run from an IF on the same line, then the format would be like so:

If A = 0 : B = 1 : C = 2 : EndIF


And these would be the two other valid formats:

If A = 0 Then B = 1

If A = 0
B = 1
C = 2
EndIf


These would be wrong:

If A = 0 Then B = 1 : C = 2

Result:
C = 2 regardless of whether A = 0 or not. C = 2 executed as if it is on the next line.


My way's better. :-) And the proof? The fact that you cannot make a single line program easily with the way Blitz works. As soon as you have an IF statement, you're screwed and have to move on to the next line, because with Blitz's way everything after that IF would become part of that IF statement.


Agamer(Posted 2004) [#16]
you know you could look at your keyboard and see what buttons your pressingwhile the monitor is off


sswift(Posted 2004) [#17]
But only if you have other lights on in your room, which I do not.


jhocking(Posted 2004) [#18]
Hey, I don't want to hear about you surfing the Internet in a darkened room.

Man, I would love to obfuscate some code by making it all one line with colons. The look on colleagues' faces when I show them my source code would be priceless!


Michael Reitzenstein(Posted 2004) [#19]
My way's better. :-) And the proof? The fact that you cannot make a single line program easily with the way Blitz works. As soon as you have an IF statement, you're screwed and have to move on to the next line, because with Blitz's way everything after that IF would become part of that IF statement.

Err... and this has immediate benefit to everyone because...?


sswift(Posted 2004) [#20]
Because you can win free video cards and other fabulous prizes in code obfuscation contests of course!