Skip to content

Commit 641f6f9

Browse files
StartAutomatingStartAutomating
authored andcommitted
docs: Turtle.LSystem improvement ( Fixes #116 )
Improving parameter docs and inner docs
1 parent 50e800f commit 641f6f9

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

Turtle.types.ps1xml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -708,20 +708,25 @@ F+F+F+F +JJJJ+ F+F+F+F ++ JJJJ' },
708708

709709
#>
710710
param(
711+
# The axiom, or starting string.
711712
[Alias('Start', 'StartString', 'Initiator')]
712713
[string]
713714
$Axiom,
714715

716+
# The rules for expanding each iteration of the axiom.
715717
[Alias('Rules', 'ProductionRules')]
716718
[Collections.IDictionary]
717719
$Rule = [Ordered]@{},
718720

721+
# The order of magnitude (or number of iterations)
719722
[Alias('Iterations', 'IterationCount', 'N', 'Steps', 'N','StepCount')]
720723
[int]
721724
$Order = 2,
722725

726+
# The ways each variable will be expanded.
723727
[Collections.IDictionary]
724728
$Variable = @{}
729+
725730
)
726731

727732
# First, let us expand our axiom
@@ -776,20 +781,26 @@ $allMatches = @([Regex]::Matches($finalState, $MatchesAny, 'IgnoreCase,IgnorePat
776781
$matchCache = @{}
777782
:nextMatch foreach ($match in $allMatches) {
778783
$m = "$match"
784+
# If we have not mapped the match to a script,
779785
if (-not $matchCache[$m]) {
786+
# find the matching replacement.
780787
foreach ($key in $Variable.Keys) {
781788
if (-not ($match -match $key)) { continue }
782789
$matchCache[$m] = $localReplacement[$key]
783790
break
784791
}
785792
}
786793

794+
# If we have a script to run
787795
if ($matchCache[$m] -is [ScriptBlock]) {
796+
# run it
788797
$null = . $matchCache[$m] $match
798+
# and continue to the next match.
789799
continue nextMatch
790800
}
791801
}
792802

803+
# return this so we can pipe and chain this method.
793804
return $this
794805

795806
</Script>

0 commit comments

Comments
 (0)