Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Screen Filler Zakraska
#1
Screen Filler Zakraska

Zakraska.bas program fills screen with dots
by dividing field into a 4x4 section or arbitrarily
and better sides of field of multiples of small sections

Row under label 3:
rotating row checks condition and repeats itself

Dot is placed strictly in an empty place and field is filled in 100%
and there are also counters of points not set and a time counter

Results:
2x2 = 2 seconds & 27ooo repetitions for 25ooo points
4x4 = 5 seconds & 65ooo repetitions for 25ooo points
8x8 = 15 seconds & 95ooo repetitions for 25ooo points
16x16 = 55 seconds & 135ooo repetitions for 25ooo points
32x32 many seconds & many repetitions for 25ooo points

Field is filled in by 100%

[Image: zakraska.gif]

Conclusion: random control is real

Code: (Select All)
w = 640: h = 400: p = w * h: Screen 12 ' zakraska.bas by Danilin
s = 8: a = w / s: b = h / s: Randomize Timer: n = 0: t = Timer

For k = 1 To s ^ 2
    For i = 0 To a - 1
        For j = 0 To b - 1
3 c = Int(Rnd * s) + 1: d = Int(Rnd * s) + 1: If Point(i * s + c, j * s + d) = 4 Then n = n + 1: GoTo 3
            PSet (i * s + c, j * s + d), 4 '+ k Mod 3
        Next: Locate h / 16 + 2, 1: Print n; "points repetition from"; p
        _Title "3akpacka: points repetition " + Str$(n)
Next: _Delay .205: Next: _Delay 1:
Print Timer - t; "seconds for"; s; "x"; s ': GoTo 5

For k = 1 To 2 ' quick
    For i = 0 To w
        For j = 0 To h
            c = Int(Rnd * w) + 1: d = Int(Rnd * h) + 1
            PSet (c, d), 0 '1: '_Delay .00005
Next: Next: Next
_Delay 1':End

5 For k = 1 To s ^ 2 * 2 ' variant
    For i = 0 To a - 1
        For j = 0 To b - 1
            c = Int(Rnd * s) + 1: d = Int(Rnd * s) + 1
            PSet (i * s + c, j * s + d), 0 '+ k Mod 3
Next: Next: _Delay .205: Next: _Delay 1
End


At end dark dots are sprayed without checking for repetitions
in number of points of product of length and width
shaded points remain

Option of canceling shading by increasing number of cycles
all one leaves shaded points

Conclusion: random without control unmanaged

This shading algorithm can show state flags from stripes

Plus there is an idea: exe reads from beginning of basic program parameters
width and height and size of square
and it is possible to paint text screen sign
and colorable quadrats possibly multicolored like a chessboard

TOTAL: absolutely random quickly fill the screen by 100%

[Image: danZELen.gif]
Write name of program in 1st line to copy & paste & save filename.bas
Insert program pictures: press print-screen-shot button
Open paint & Paste & Save as PNG
Add picture file to program topic

Russia looks world from future. Big data is peace data.
I never recommend anything & always write only about myself
Reply
#2
Can you code it to go in reverse? Thinking of a neat effect where the system randomly loads an image under a solid overlay screen, which dissolves away by dots until the underlying image is completely revealed. Put a timer on it, and you have a multiplayer guessing game.

Pete
Reply
#3
I did that in Blackjack with Dealer's Dialog, while talking, the static on a little screen coalesced into text.
b = b + ...
Reply
#4
I think it's more interesting to implement chess filling and reverse

where posible variants


[Image: ch64.png]
Write name of program in 1st line to copy & paste & save filename.bas
Insert program pictures: press print-screen-shot button
Open paint & Paste & Save as PNG
Add picture file to program topic

Russia looks world from future. Big data is peace data.
I never recommend anything & always write only about myself
Reply




Users browsing this thread: 1 Guest(s)