Conditional structures: Difference between revisions
→{{header|Ed}}: Fix syntax and punctuation
Langurmonkey (talk | contribs) |
(→{{header|Ed}}: Fix syntax and punctuation) |
||
(One intermediate revision by the same user not shown) | |||
Line 2,501:
print i & " is not divisible by 2 or 3"
.
</syntaxhighlight>
=={{header|Ed}}==
Note that ed, unlike more advanced [[Sed]], has no conditional branching. Still, conditionals can be simulated with global match/no-match rules:
<syntaxhighlight>
g/True/s//It's true!/p
v/True/s/.*/It's false!/p
</syntaxhighlight>
|