Pages: 1 2
Topic closed
dvd4 wrote:
subzerostig wrote:
How about this prime number calculator?
when I receive [Check_if_prime v] forever change [Counter1 v] by [1] if ((item (Counter1) of "Prime numbers" ) > ((round ( "sqrt" of (Number_being_worked_out))) + 1)) add (Number_being_worked_out v) to (List of Primes) add (Number_being_worked_out v) to (Prime numbers) stop script end if <((round ((Number_being_worked_out) / (item (Counter1) of "Prime numbers" ))) = ((Number_being_worked_out) / (item (Counter1) of "Prime numbers" ))) > stop script end when gf clicked set [Number_being_worked_out v] to [5] delete [all v] of (Prime numbers) delete [all v] of (List of Primes) add [2] to (Prime numbers) add [3] to (Prime numbers) add [5] to (Prime numbers) add [2] to (List of Primes) add [3] to (List of Primes) add [5] to (List of Primes) forever change [Number_being_worked_out v] by [1] set (Counter1 v) to [0] broadcast [Check_if_prime v] and wait endSorry if blocks are a bit buggy. I haven't used the new format yet.
I ported the code from a previous Autoit3 script I made a while back.fixing ...
Could you fix the operators? I'm pretty bad at scratchblocks, and shift-clicking file to save as project summary isn't really that compatible with scratchblocks
Offline
Guys the contest is over and the contest runner is sick so he told me to end the contest.Thewinners will be announced.
Offline
FINAL SCORES
1st is subzerostig with 409 Points!
- 2nd is fg123 with 307 Points!
- 3rd is zubblewu with 78 Points!
- 4th is amcerbu with 7points
x
How many people have entered:5
Offline
subzerostig wrote:
dvd4 wrote:
subzerostig wrote:
How about this prime number calculator?
when I receive [Check_if_prime v] forever change [Counter1 v] by [1] if ((item (Counter1) of "Prime numbers" ) > ((round ( "sqrt" of (Number_being_worked_out))) + 1)) add (Number_being_worked_out v) to (List of Primes) add (Number_being_worked_out v) to (Prime numbers) stop script end if <((round ((Number_being_worked_out) / (item (Counter1) of "Prime numbers" ))) = ((Number_being_worked_out) / (item (Counter1) of "Prime numbers" ))) > stop script end when gf clicked set [Number_being_worked_out v] to [5] delete [all v] of (Prime numbers) delete [all v] of (List of Primes) add [2] to (Prime numbers) add [3] to (Prime numbers) add [5] to (Prime numbers) add [2] to (List of Primes) add [3] to (List of Primes) add [5] to (List of Primes) forever change [Number_being_worked_out v] by [1] set (Counter1 v) to [0] broadcast [Check_if_prime v] and wait endSorry if blocks are a bit buggy. I haven't used the new format yet.
I ported the code from a previous Autoit3 script I made a while back.fixing ...
Could you fix the operators? I'm pretty bad at scratchblocks, and shift-clicking file to save as project summary isn't really that compatible with scratchblocks
I'm fixing it.
Offline
scratchcontest2012's account was closed.
Offline
A real script:
when I receive [xxx nb / v] if <(right type) = [nb]> set [index v] to [1] set [decimal places v] to [0] set [point reached? v] to [no] set [active pointer v] to (nb right) broadcast [vc get length v] and wait repeat ((vc index) - (1)) set [vc index v] to (join [n+] (index)) set [active pointer v] to (nb right) broadcast [vc lookup v] and wait if <(active pointer) = [.]> set [point reached? v] to [yes] else if <(point reached?) = [no]> change [decimal places v] by (1) end end change [index v] by (1) end set [active pointer v] to (nb right) set [places to append v] to (decimal places) broadcast [xxx nb append places v] and wait set [temp dec places v] to (decimal places) end if <(left type) = [nb]> set [div remain v] to [n+0] set [tleft v] to (nb left) set [tright v] to (nb right) delete (all v) of [div ans list v] set [active pointer v] to (nb left) broadcast [vc get length v] and wait set [div index v] to (active pointer) repeat ((vc index) - (1)) change [div index v] by (-1) set [vc index v] to (join [n+] (div index)) set [active pointer v] to (tleft) broadcast [vc lookup v] and wait if <(active pointer) = [.]> insert [.] at (1 v) of [div ans list v] else set [nb right v] to (active pointer) set [active pointer v] to (div remain) set [places to append v] to [1] broadcast [xxx nb append places v] and wait set [nb left v] to (active pointer) broadcast [nb add v] and wait set [div remain v] to (active pointer) broadcast [xxx nb div binsearch v] and wait insert (answer) at (1 v) of [div ans list v] end end else set [div remain v] to (nb left) end set [div index v] to [0] repeat until <<<(div remain) = [n+0]> or <(div index) = [15]>> or <(max integer) = ((round (length of [answer-list v] )) / (3))>> if <not < [div ans list v] contains [.]>> insert [.] at (1 v) of [div ans list v] end set [nb right v] to (active pointer) set [active pointer v] to (div remain) set [places to append v] to [1] broadcast [xxx nb append places v] and wait set [div remain v] to (active pointer) broadcast [xxx nb div binsearch v] and wait insert (answer) at (1 v) of [div ans list v] end set [nb left v] to (tleft) set [nb right v] to (tright) broadcast [xxx nb check signs v] and wait if <(left type) = (right type)> add [+] to [div ans list v] else add [-] to [div ans list v] end delete (all v) of [answer-list v] repeat (length of [div ans list v] ) add (item (last v) of [div ans list v] ) to [answer-list v] delete (last v) of [div ans list v] end broadcast [xxx nb make answer vector v] and wait set [places to append v] to ((0) - (temp dec places)) broadcast [xxx nb append places v] and wait set [div remain v] to [vd0] set [tleft v] to [vd0] set [tright v] to [vd0]
Offline
Is this block spam? Should this really be in "Help with Scripts"?
Last edited by MoreGamesNow (2012-11-07 13:17:19)
Offline
Sorry - but this does not belong in Help with Scripts, since there is no actual help being given. As far as I can tell, the score seems to be related to the length of the script - which is going to encourage a lot of really long posts.
This looks more like a game to me - perhaps it belongs in the Text-Based Games Forum
Offline
Topic closed
Pages: 1 2