Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

contemplate where salmon spawn when they have a home #12

Open
quinkennedy opened this issue Nov 7, 2012 · 2 comments
Open

contemplate where salmon spawn when they have a home #12

quinkennedy opened this issue Nov 7, 2012 · 2 comments

Comments

@quinkennedy
Copy link
Owner

given the following program:
hello a friend

creating the river:
hello--a--friend

and the input:
a

does the salmon spawn at the middle node 'a' or and the final node 'friend'

@quinkennedy
Copy link
Owner Author

from original documentation:
Springs are the homes of salmon. Salmon always swim to their home springs, springs with the same text as the salmon. If the Salmon has no home spring or cannot reach its home spring, it takes the path closest to the top of the program.

Once a salmon reaches a spring, a new, young, identical salmon is created.
Note: hello-1 and hello-2 show that this does not mean first spring

...To simplify things only `nodes', points where two rivers come together, are considered. The tokens are therefore interpreted as a tree.

(null):
Nothing. These tokens can only be created when spaces can not move the current position up the tree any more. They are also automatically created to balance the tree. Salmon will not enter these when swimming upstream unless they have a specific destination.

Each program is a set of rivers that flows into the watershed (the screen). Information is carried by water (a priority queue), which flows from the springs (constants) through the network of rivers (which represents a red-black binary tree)

@quinkennedy
Copy link
Owner Author

from 0.1 documentation:
For each upstream salmon, an in-order search of the river system is conducted to find a river node with the same name as the salmon. If there is such a node and the salmon is not prevented from moving towards it, the salmon moves towards that node. If there is no such node or if the salmon is prevented from moving towards that node, the salmon will attempt to move (in order) to each child of the current node. If the salmon cannot move to any child of the current node or if there are no children of the current node, the salmon will spawn at the current node.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant