Rosetta Code:Solve a Task: Difference between revisions

Restored to undamaged version
m (Reverted edits by Mustabelmo (talk) to last revision by Tigerofdarkness)
(Restored to undamaged version)
Tag: Manual revert
 
(24 intermediate revisions by 8 users not shown)
Line 17:
<pre>
=={{header|Ayrch}}==
<langsyntaxhighlight Ayrchlang="ayrch">PRINT "Goodbye, World!"</langsyntaxhighlight>
</pre>
Remember, for the sake of simplicity, we're assuming your language is Ayrch, and the task is [[Hello world]]. We're also assuming, for the moment, that Ayrch looks a lot like BASIC.
Once you've added your code, hit the preview button to make sure you crossed all your T's and closed all your tags. If the language name shows up in red (a broken link), then either the language doesn't exist on the site yet (as a category), or you misspelled/mis-capitalized the name. Check your spelling against the one in [[:Category:Programming Languages]].
That's all you really need to do!
 
<!--
 
PROGRAM-ID. ARMSTRONG-NUMS.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 num-length PIC 9(2) value 0.
01 in-sum PIC 9(9) value 0.
01 counter PIC 9(9) value 0.
01 current-number PIC 9(9) value 0.
01 temp PIC 9(9) value 0.
01 modulo PIC 9(9) value 0.
01 answer PIC 9 .
PROCEDURE DIVISION.
MAIN-PROCEDURE.
DISPLAY "the first 25 armstrong numbers " .
MOVE 25 TO counter.
PERFORM UNTIL counter=0
PERFORM 000-ARMSTRONG-PARA
IF answer = 1
SUBTRACT 1 from counter
GIVING counter
DISPLAY current-number
END-IF
ADD 1 to current-number
END-PERFORM
STOP RUN.
000-ARMSTRONG-PARA.
MOVE ZERO to in-sum.
MOVE current-number to temp.
COMPUTE num-length =1+ Function Log10(temp)
PERFORM UNTIL temp=0
DIVIDE temp BY 10 GIVING temp
REMAINDER modulo
COMPUTE modulo=modulo**num-length
ADD modulo to in-sum GIVING in-sum
END-PERFORM.
IF current-number=in-sum
MOVE 1 TO answer
ELSE MOVE 0 TO answer
END-if.
END PROGRAM ARMSTRONG-NUMS.
-->
 
=Going a little further=
Line 84 ⟶ 40:
{{libheader|Ayrch Console Extensions}}
 
<langsyntaxhighlight lang="ayrch">PRINT "Goodbye, World!"</langsyntaxhighlight>
</pre>
 
Line 95 ⟶ 51:
{{works with|Ayrch Virtual Machine|6.2}}
 
<langsyntaxhighlight lang="ayrch">PRINT "Goodbye, World!"</langsyntaxhighlight>
 
</pre>
7,795

edits