ConwayLife.com - A community for Conway's Game of Life and related cellular automata
Home  •  LifeWiki  •  Forums  •  Download Golly

Problem with Scratch CA script

Has something gone haywire? Let us know about it!

Problem with Scratch CA script

Postby gameoflifemaniac » March 2nd, 2018, 12:52 pm

This was supposed to be a script that can run any B/S rule on a closed 19*19 grid.
https://scratch.mit.edu/projects/207360033/#editor
But it doesn't work! What's wrong with this script?
https://www.youtube.com/watch?v=q6EoRBvdVPQ
One big dirty Oro. Yeeeeeeeeee...
User avatar
gameoflifemaniac
 
Posts: 583
Joined: January 22nd, 2017, 11:17 am
Location: Poland

Re: Problem with Scratch CA script

Postby rowett » March 2nd, 2018, 1:18 pm

gameoflifemaniac wrote:This was supposed to be a script that can run any B/S rule on a closed 19*19 grid.
https://scratch.mit.edu/projects/207360033/#editor
But it doesn't work! What's wrong with this script?

Interesting stuff...

The first problem I found is that you need to set the pen colour before updating the grid at the end.
rowett
Moderator
 
Posts: 856
Joined: January 31st, 2013, 2:34 am
Location: UK

Re: Problem with Scratch CA script

Postby gameoflifemaniac » March 2nd, 2018, 2:18 pm

rowett wrote:
gameoflifemaniac wrote:This was supposed to be a script that can run any B/S rule on a closed 19*19 grid.
https://scratch.mit.edu/projects/207360033/#editor
But it doesn't work! What's wrong with this script?

Interesting stuff...

The first problem I found is that you need to set the pen colour before updating the grid at the end.

Idk
Even if I fixed this script, it would be painfully slow. This prototype was actually an attempt to fix an issue that occured in my first prototype, because that one was the SECOND. The first is much faster, because the square doesn't have to move to the neighboring cells and check if it's touching grey. Instead, it checks the value of item for example cell#+1 or cell#-20 or cell+19. But something weird happens at the edge. If you draw something, you'll find out why.
Here's the script:
https://scratch.mit.edu/projects/207380010/
But I found out how to fix that. I just have to not allow the neighbor count to increase by 1 in special cases. For example:
if item(cell#-1)of pattern = 1 and not(cell# mod 19 = 1) then
change neighbor count by 1
That means that if the cell that the square is checking is on the left edge, the cell cell#-1 (which is on the right edge one line above), won't be taken into account. But I'm too lazy to do this now :lol:
https://www.youtube.com/watch?v=q6EoRBvdVPQ
One big dirty Oro. Yeeeeeeeeee...
User avatar
gameoflifemaniac
 
Posts: 583
Joined: January 22nd, 2017, 11:17 am
Location: Poland

Re: Problem with Scratch CA script

Postby BlinkerSpawn » March 2nd, 2018, 6:03 pm

I believe it's wrapping horizontally and vertically but not both at once for corner cases.
LifeWiki: Like Wikipedia but with more spaceships. [citation needed]

Image
User avatar
BlinkerSpawn
 
Posts: 1715
Joined: November 8th, 2014, 8:48 pm
Location: Getting a snacker from R-Bee's

Re: Problem with Scratch CA script

Postby gameoflifemaniac » March 3rd, 2018, 2:55 am

Ok, I added the neighborhood exceptions. The third prototype is here:
https://scratch.mit.edu/projects/207474227/
But it doesn't work either! For example, the loaf dies when it's on the edge. Help!
https://www.youtube.com/watch?v=q6EoRBvdVPQ
One big dirty Oro. Yeeeeeeeeee...
User avatar
gameoflifemaniac
 
Posts: 583
Joined: January 22nd, 2017, 11:17 am
Location: Poland

Re: Problem with Scratch CA script

Postby 77topaz » March 3rd, 2018, 5:24 am

gameoflifemaniac wrote:Ok, I added the neighborhood exceptions. The third prototype is here:
https://scratch.mit.edu/projects/207474227/
But it doesn't work either! For example, the loaf dies when it's on the edge. Help!


Additionally, the corners of the box break when you try a B0 rule.
User avatar
77topaz
 
Posts: 595
Joined: January 12th, 2018, 9:19 pm

Re: Problem with Scratch CA script

Postby gameoflifemaniac » March 3rd, 2018, 9:37 am

77topaz wrote:
gameoflifemaniac wrote:Ok, I added the neighborhood exceptions. The third prototype is here:
https://scratch.mit.edu/projects/207474227/
But it doesn't work either! For example, the loaf dies when it's on the edge. Help!


Additionally, the corners of the box break when you try a B0 rule.

What I did do wrong?
https://www.youtube.com/watch?v=q6EoRBvdVPQ
One big dirty Oro. Yeeeeeeeeee...
User avatar
gameoflifemaniac
 
Posts: 583
Joined: January 22nd, 2017, 11:17 am
Location: Poland

Re: Problem with Scratch CA script

Postby gameoflifemaniac » March 3rd, 2018, 1:12 pm

GG
I did the script!!!
https://scratch.mit.edu/projects/207527992/
It seems to work, and it's only lite because it does only one main feature: calculating the pattern. The full version will contain a population counter and a rule displayer and will be released soon. Maybe I will make the grid bigger...
https://www.youtube.com/watch?v=q6EoRBvdVPQ
One big dirty Oro. Yeeeeeeeeee...
User avatar
gameoflifemaniac
 
Posts: 583
Joined: January 22nd, 2017, 11:17 am
Location: Poland

Re: Problem with Scratch CA script

Postby 77topaz » March 3rd, 2018, 3:56 pm

gameoflifemaniac wrote:GG
I did the script!!!
https://scratch.mit.edu/projects/207527992/
It seems to work, and it's only lite because it does only one main feature: calculating the pattern. The full version will contain a population counter and a rule displayer and will be released soon. Maybe I will make the grid bigger...


Now, instead of just breaking at the corners for B0 rules, it breaks all along the edges. :P
User avatar
77topaz
 
Posts: 595
Joined: January 12th, 2018, 9:19 pm

Re: Problem with Scratch CA script

Postby gameoflifemaniac » March 3rd, 2018, 5:01 pm

77topaz wrote:
gameoflifemaniac wrote:GG
I did the script!!!
https://scratch.mit.edu/projects/207527992/
It seems to work, and it's only lite because it does only one main feature: calculating the pattern. The full version will contain a population counter and a rule displayer and will be released soon. Maybe I will make the grid bigger...


Now, instead of just breaking at the corners for B0 rules, it breaks all along the edges. :P

This is normal. It's a closed grid.
https://www.youtube.com/watch?v=q6EoRBvdVPQ
One big dirty Oro. Yeeeeeeeeee...
User avatar
gameoflifemaniac
 
Posts: 583
Joined: January 22nd, 2017, 11:17 am
Location: Poland

Re: Problem with Scratch CA script

Postby 77topaz » March 3rd, 2018, 5:05 pm

gameoflifemaniac wrote:This is normal. It's a closed grid.


But wouldn't it make more sense to have the edges automatically stay in the right state, as they would if the entire universe were "strobing"?
User avatar
77topaz
 
Posts: 595
Joined: January 12th, 2018, 9:19 pm

Re: Problem with Scratch CA script

Postby gameoflifemaniac » March 3rd, 2018, 5:08 pm

77topaz wrote:But wouldn't it make more sense to have the edges automatically stay in the right state, as they would if the entire universe were "strobing"?

What do you mean? They do!
https://www.youtube.com/watch?v=q6EoRBvdVPQ
One big dirty Oro. Yeeeeeeeeee...
User avatar
gameoflifemaniac
 
Posts: 583
Joined: January 22nd, 2017, 11:17 am
Location: Poland

Re: Problem with Scratch CA script

Postby 77topaz » March 3rd, 2018, 5:13 pm

gameoflifemaniac wrote:
77topaz wrote:But wouldn't it make more sense to have the edges automatically stay in the right state, as they would if the entire universe were "strobing"?

What do you mean? They do!


No, the cells at the edges don't act as if the entire universe were strobing. For example, try B012345678/S5. The edges in this rule should simply strobe, but they remain alive at the transition from a live background to a dead one, because the simulator treats them as if they have five live neighbours rather than eight. Thus, it is clear that this simulator treats every cell outside the box as always dead, even for B0 rules where they should strobe.
Last edited by 77topaz on March 3rd, 2018, 6:41 pm, edited 1 time in total.
User avatar
77topaz
 
Posts: 595
Joined: January 12th, 2018, 9:19 pm

Re: Problem with Scratch CA script

Postby gameoflifemaniac » March 3rd, 2018, 5:34 pm

77topaz wrote:
gameoflifemaniac wrote:What do you mean? They do!


No, the cells at the edges don't act as if the entire universe were strobing. For example, try B012345678/S5. The edges in this rule should simply strobe, but they remain alive at the transition from a live background to a dead one, because the simulator treats them as if they have five live neighbours rather than eight. Thus, it is clear that this simulator treats every cell outside the box as always dead, even for B0 rules were they should strobe.

Ahh... But it runs the same as in Golly. If you run the rule R1, C0, S5..5, B0..8, NM:P19,19 (B012345678/S5:P19,19),
it would behave just as in the script.
https://www.youtube.com/watch?v=q6EoRBvdVPQ
One big dirty Oro. Yeeeeeeeeee...
User avatar
gameoflifemaniac
 
Posts: 583
Joined: January 22nd, 2017, 11:17 am
Location: Poland

Re: Problem with Scratch CA script

Postby fluffykitty » March 3rd, 2018, 5:46 pm

Well, what do you want to do?
I like making rules
fluffykitty
 
Posts: 326
Joined: June 14th, 2014, 5:03 pm

Re: Problem with Scratch CA script

Postby gameoflifemaniac » March 4th, 2018, 6:27 am

fluffykitty wrote:Well, what do you want to do?

In what sense?
https://www.youtube.com/watch?v=q6EoRBvdVPQ
One big dirty Oro. Yeeeeeeeeee...
User avatar
gameoflifemaniac
 
Posts: 583
Joined: January 22nd, 2017, 11:17 am
Location: Poland

Re: Problem with Scratch CA script

Postby gameoflifemaniac » March 4th, 2018, 8:40 am

Btw, here's the complete script.
https://scratch.mit.edu/projects/209098001/
https://www.youtube.com/watch?v=q6EoRBvdVPQ
One big dirty Oro. Yeeeeeeeeee...
User avatar
gameoflifemaniac
 
Posts: 583
Joined: January 22nd, 2017, 11:17 am
Location: Poland

Re: Problem with Scratch CA script

Postby gameoflifemaniac » March 23rd, 2018, 1:39 pm

I'm working on a function that copies the pattern into RLE format. But it works only for one-cell thick patterns. For other patterns it never stops the calculation! Help!
Last edited by gameoflifemaniac on March 23rd, 2018, 1:45 pm, edited 1 time in total.
https://www.youtube.com/watch?v=q6EoRBvdVPQ
One big dirty Oro. Yeeeeeeeeee...
User avatar
gameoflifemaniac
 
Posts: 583
Joined: January 22nd, 2017, 11:17 am
Location: Poland

Re: Problem with Scratch CA script

Postby BlinkerSpawn » March 23rd, 2018, 1:44 pm

gameoflifemaniac wrote:I'm working on a function that copies the pattern into RLE format. But it works only for one-cell thick patterns! Help!

Your script should be inserting a '$' at the end of each row to indicate a new row.
LifeWiki: Like Wikipedia but with more spaceships. [citation needed]

Image
User avatar
BlinkerSpawn
 
Posts: 1715
Joined: November 8th, 2014, 8:48 pm
Location: Getting a snacker from R-Bee's

Re: Problem with Scratch CA script

Postby gameoflifemaniac » March 23rd, 2018, 4:18 pm

BlinkerSpawn wrote:
gameoflifemaniac wrote:I'm working on a function that copies the pattern into RLE format. But it works only for one-cell thick patterns! Help!

Your script should be inserting a '$' at the end of each row to indicate a new row.

I mean, read my post once again, because I edited it.
EDIT: I figured out how to fix it.
EDIT: Fixed!
EDIT: The link to the script is now different.
https://scratch.mit.edu/projects/213417388/
https://www.youtube.com/watch?v=q6EoRBvdVPQ
One big dirty Oro. Yeeeeeeeeee...
User avatar
gameoflifemaniac
 
Posts: 583
Joined: January 22nd, 2017, 11:17 am
Location: Poland


Return to Bugs & Errors

Who is online

Users browsing this forum: No registered users and 3 guests