Rosetta Code:Solve a Task: Difference between revisions

Restored to undamaged version
m (Correct links to old "User Output" task)
(Restored to undamaged version)
Tag: Manual revert
 
(45 intermediate revisions by 16 users not shown)
Line 13:
 
==Adding Code==
Language examples on each page are in alphabetical order, so you need to find where your example would fit. Once you've found that, click the "edit" link closest above the area where you want to insert your code on the task page, and add something like this to the bottom of the edit field:
 
<pre>
Language examples on each page are in alphabetical order, so you need to find where your example would fit. Once you've found that, click the "edit" link closest above the area where you want to insert your code, and add something like this to the bottom of the edit field:
<pre>=={{header|Ayrch}}==
 
<syntaxhighlight lang Ayrch="ayrch">PRINT "Goodbye, World!"</lang></presyntaxhighlight>
<pre>=={{header|Ayrch}}==
</pre>
 
<lang Ayrch>PRINT "Goodbye, World!"</lang></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!
 
Line 38 ⟶ 35:
It's perfectly all right to depend on external (or even non-standard) libraries in your code examples. However, it can be problematic for others if they don't know they need to use a library, or don't know where to find it. There's a template for that: '''libheader'''.
 
<pre>
<pre>=={{header|Ayrch}}==
 
{{libheader|Ayrch Console Extensions}}
 
<syntaxhighlight lang ="ayrch">PRINT "Goodbye, World!"</lang></presyntaxhighlight>
</pre>
 
The '''libheader''' template identifies that your code uses that library, and will even provide a link to where a description of that library may be found.
 
==Works With==
Not all code works with all versions of a language, all versions of a compiler, interpreter or other implementation, or even all operating systems that the language may run on. If you're aware of certain constraints or other prerequisites that haven't already been mentioned, try using the '''works with''' template.
 
<pre>
<pre>=={{header|Ayrch}}==
 
{{works with|Ayrch Virtual Machine|6.2}}
 
<syntaxhighlight lang ="ayrch">PRINT "Goodbye, World!"</lang></presyntaxhighlight>
 
</pre>
 
=Conclusion=
 
Thank you for adding code, and even more thanks ofif you added the spit and polish to make your code shine!
 
==Where to go?==
7,795

edits