Jump to content

Help:Adding a new programming example: Difference between revisions

m
→‎Navigation: Fixed mentions of GCC to point to compiler, not collection
(→‎Navigation: edit is a tab, not a button)
m (→‎Navigation: Fixed mentions of GCC to point to compiler, not collection)
Line 9:
To add your own programming example, you must [[:Category:Solutions by Programming Task|navigate]] to the programming task to which you wish to add a solution to. Once you find your task, go ahead and click the Edit tab at the top of the page, find the place in the list of languages already applied where your language would fall alphabetically, and make your changes.
 
In order to maintain the readability, searchability and browsabilitybrowseability of Rosetta Code, we need you to follow certain formatting rules. Please ensure that your contributed code conforms to one of these [[Help:Programming Example Prototypes|programming example prototypes]]. A simple example should look something like this:
 
<nowiki>
=={{header|C}}==
'''Compiler:''' [[GCCgcc]] 4.0.1
int main ( void ) {
Line 19:
}</nowiki>
 
You don't have to use the C programming language, and your code example will probably be different. You need to make sure you create a link to your language of choice, and to your compiler, interpreter, or what-have-you. To create a link, surround the text with double square brackets. For example, [[GCCgcc]] would be represented as <nowiki>[[GCCgcc]]</nowiki>.
 
Finally, note the importance of the extra space in front of the code. That creates a dashed box around the code sample, and puts it in a monospace font.
Cookies help us deliver our services. By using our services, you agree to our use of cookies.