Placing the woman's new shoe rule at the top of the program? What were you thinking?
Now I updated it with woman's intuition.
rem START OF PROGRAM
remstart : rem start of a rem block
Project Title: Super Fast Ultra Uber Screen Clearing Engine : rem the title of the project
Author: THE DBP IDIOTS : rem the authors
Development Started: dunno
Version: hxa23.buc3chub.bananas(the_safeword_is_always_banana).34.monkey.use_the_force_luke
remend : rem end of rem block
GLOBAL screen_width
GLOBAL screen_height
screen_width = 640 : rem sets the value of "screen_width" to 640
screen_height = 480 : rem sets the value of "screen_hegiht" to 480
rem TO MAKE SURE THAT THEY DON'T LOSE THEIR VALUES
screen_width = screen_width
screen_height = screen_height
SET DISPLAY MODE screen_width, screen_height, 32
SYNC ON : rem turns on sync
DO : rem does
red = RND(255)
green = RND(255)
blue = RND(255)
while check_if_the_screen_was_actually_cleared( RGB( red, green, blue ) ) = 0
my_dead_fast_clear_screen_made_even_faster_by_TheComet_using_the_shoe_rule_for_women( RGB( red, green, blue ) )
process_womans_intuition_by_using_super_random_technology( rnd(46 )
endwhile
rem making super DUPER sure the screen is cleared
cls
SYNC : rem syncs
LOOP : rem loops
rem The following command acts like a road-block, or some might say a death squad, what it does
rem is that it will prevent the program from running anything beyond this point.
rem When the program cursor reaches this command it sends an instruction that causes the program
rem to interrupt at this position and terminate, the effect of this is that the dark basic pro
rem runtime environment is closed and, if the program was being run in full screen, the user is
rem returned to the vindows.
END
rem whitespace
FUNCTION my_dead_fast_clear_screen_made_even_faster_by_TheComet_using_the_shoe_rule_for_women( colour )
INK colour, colour : rem sets the ink colour to [colour],[colour]
BACKDROP OFF : rem turns off the backdrop (turns the backdrop off)
FOR x = 0 TO screen_width - 1 : rem starts a for loop where x = 0 to screen_width
IF rnd(100) = 1 then goto NewShoes : rem decide if she is still happy with the color of her shoes, and by shoes we mean the screen
NewShoes: : rem invariably, a random amount of time after buying a new pair of shoes, a woman (and by that of course I mean my wife) will always decide that her new shoes aren't what she really wanted and will go back and buy a new pair in a different color.
FOR y = 0 TO screen_height - 1 : rem starts a for loop where y = 0 to screen_height
INK colour, colour : rem sets the ink colour to [colour],[colour]
DOT x, y : rem draws a dot at x,y
SYNC : rem syncs
NEXT y : rem increments y
process_womans_intuition_by_using_super_random_technology( rnd(46 )
NEXT x : rem increments x
BACKDROP ON : rem turns the backdrop back on
ENDFUNCTION
rem whitespace
function check_if_the_screen_was_actually_cleared( colour )
success = 1 rem sets the value of "success" to 1
for x = 0 to screen_width - 1
process_womans_intuition_by_using_super_random_technology( rnd(46 )
for y = 0 to screen_height - 1
if point( x, y ) <> colour then success = 0 : rem MAKING USE OF LEE BAMBER'S ULTRA FAST "POINT" FUNCTION!
rem also, we don't need to exit the function when we find a non-matching pixel. We have to continue checking the rest so we know that others failed as well
next y
next x
endfunction success
rem Whitespace
rem I have no idea what this does. Magic, do not touch.
rem NOTE: this function will only work with shoe numbers between 2 and 46
rem don't ask why, I don't know
function process_womans_intuition_by_using_super_random_technology( numberOfShoes )
if SuperRand() = numberOfShoes then goto NewShoes
endfunction
rem this function was ripped from here: http://thedailywtf.com/Articles/SuperRand.aspx
rem NOTE: random number functions don't produce true random numbers.
rem adding them together will improve the randomness by
function SuperRand()
local iBadRandom As Integer
local iGoodRandom As Integer
randomize timer() : rem randomizes the timer
iBadRandom = rnd(46) + 1
iGoodRandom = rnd(23) + 1
iGoodRandom = iGoodRandom + rnd(23) + 1
while iGoodRandom = iBadRandom
iGoodRandom = rnd(23) + 1
iGoodRandom = iGoodRandom + rnd(23) + 1
endwhile
SuperRand = iGoodRandom
endfunction SuperRand
rem END OF PROGRAM