Skip to content

Commit

Permalink
fix Collatz example
Browse files Browse the repository at this point in the history
  • Loading branch information
drupol committed Oct 21, 2022
1 parent d70702d commit 6ec0563
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/pages/code/collatz-conjecture.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
? [$value / 2]
: [$value * 3 + 1];

$collection = Collection::unfold($collatz, 10)
$collection = Collection::unfold($collatz, 50)
->unwrap()
->until(static fn (int $number): bool => 1 === $number);

print_r($c->all()); // [25, 76, 38, 19, 58, 29, 88, 44, 22, 11, 34, 17, 52, 26, 13, 40, 20, 10, 5, 16, 8, 4, 2, 1]
print_r($collection->all()); // [25, 76, 38, 19, 58, 29, 88, 44, 22, 11, 34, 17, 52, 26, 13, 40, 20, 10, 5, 16, 8, 4, 2, 1]

0 comments on commit 6ec0563

Please sign in to comment.