TIS-100

TIS-100

2
   
Award
Favorite
Favorited
Unfavorite
2 Comments
elidoran  [author] 28 Jan, 2023 @ 5:14pm 
When a prime is a factor it's passed forward as a positive value which later front nodes (A1, B1, C1, D1) pass on as well until it reaches the OUT node. Then the same node tries the same prime on the reduced N (the original N divided by the prime factor just sent on). It repeats that until it can't do any more.

When a prime isn't a factor the node passes on the N value to try with the next prime, or to the OUT node to be sent as the last prime factor and end the sequence with a zero. These N values are negated so they are seen as different than the prime factors and handled differently.

When an N is factored completely by 2, 3, 5, or 7, a -1 is passed on and each subsequent front node will do a little unnecessary work before passing it on and the OUT node turns that into a terminating zero.
elidoran  [author] 28 Jan, 2023 @ 5:14pm 
The nodes have their sequence and ID's in them. The data flows thru node pairs: A, B, C, D and then ends at the OUT node. The front nodes are A1, B1, C1, and D1. Their supporting nodes are A2, B2, C2, D2. The front nodes receive the new N and pass on both prime factors and N's they can't factor any more with their prime.

The overall idea is to have 4 pairs of nodes with each pair focusing on a single possible prime factor: 2, 3, 5, and 7. These are the only primes needed in this challenge because the next prime is 11 and its square is 121 and none of the values can reach 121 because they're limited to two digit numbers.