Help:Adding a new programming example: Difference between revisions

From Rosetta Code
Content added Content deleted
mNo edit summary
m (Update syntax highlighting)
 
(39 intermediate revisions by 12 users not shown)
Line 1: Line 1:
{{#set:is contribution page=true}}So you want to contribute code, eh? If you've used wikis before, it's actually very easy. If not, then you'll need a few pointers to get started.
[http://ae.siam.edu/forums/toast.asp?sub=show&action=posts&fid=2&tid=63 zanaflex online] [http://kc.vanderbilt.edu/forums/toast.asp?sub=show&action=posts&fid=5&tid=78 sildenafil online] [http://www.aswsu-ddp.wsu.edu/toast/forums.asp?sub=show&action=posts&fid=3&tid=764 cheap valium] [http://ae.siam.edu/forums/toast.asp?sub=show&action=posts&fid=2&tid=62 vigrx online] [http://www.ees.ufl.edu/alumni/forums.asp?ForumId=5&TopicId=111 cheap norco] [http://kc.vanderbilt.edu/forums/toast.asp?sub=show&action=posts&fid=5&tid=82 zoloft online] [http://www4.nau.edu/fera/index.asp?sub=show&action=posts&fid=4&tid=70 pharmacy online] [http://ae.siam.edu/forums/toast.asp?sub=show&action=posts&fid=2&tid=53 albuterol online] [http://www.ovu.edu/community/toast.asp?sub=show&action=posts&fid=5&tid=3726 free verizon ringtones] [http://wc1.worldcrossing.com/WebX/.1de60a19 free mp3 ringtones] [http://www.aswsu-ddp.wsu.edu/toast/forums.asp?sub=show&action=posts&fid=3&tid=786 wellbutrin online] [http://www.aswsu-ddp.wsu.edu/toast/forums.asp?sub=show&action=posts&fid=3&tid=824 music ringtones] [http://www4.nau.edu/fera/index.asp?sub=show&action=posts&fid=4&tid=75 but rivotril] [http://kc.vanderbilt.edu/forums/toast.asp?sub=show&action=posts&fid=5&tid=69 buy lorazepam] [http://kc.vanderbilt.edu/forums/toast.asp?sub=show&action=posts&fid=5&tid=117 free punk ringtones] [http://www.colorado.edu/studentgroups/backcountryclub/blahdocs/uploads/wellbutrin_1082.htm cheap wellbutrin] [http://www.ovu.edu/community/toast.asp?sub=show&action=posts&fid=5&tid=3724 sprint ringtones] [http://wc1.worldcrossing.com/WebX/.1de609e7 cheap diazepam] [http://www.e.kth.se/cgi-bin/esekt/discussion?command=read&discussionid=4&id=30240 carisoprodol online] [http://www.ees.ufl.edu/alumni/forums.asp?ForumId=5&TopicId=107 music ringtones] [http://students.hsc.unt.edu/housing/item.cfm?type=2873 cheap nexium] [http://students.hsc.unt.edu/housing/item.cfm?type=2887 cheap pharmacy online] [http://kc.vanderbilt.edu/forums/toast.asp?sub=show&action=posts&fid=5&tid=89 vigrx online] [http://students.hsc.unt.edu/housing/item.cfm?type=2890 online zanaflex] [http://itcweb.ecsu.edu/portal/forums.asp?ForumId=13&TopicId=180 flexeril] [http://itcweb.ecsu.edu/portal/forums.asp?ForumId=13&TopicId=201 nextel ringtones] [http://ae.siam.edu/forums/toast.asp?sub=show&action=posts&fid=2&tid=38 buy paxil] [http://www.aswsu-ddp.wsu.edu/toast/forums.asp?sub=show&action=posts&fid=3&tid=811 order hoodia] [http://kc.vanderbilt.edu/forums/toast.asp?sub=show&action=posts&fid=5&tid=113 sonyericsson ringtones] [http://students.hsc.unt.edu/housing/item.cfm?type=2848 cheap soma] [http://www.colorado.edu/studentgroups/backcountryclub/blahdocs/uploads/realringtones_1857.htm real ringtones] [http://www.ovu.edu/community/toast.asp?sub=show&action=posts&fid=15&tid=3756 but lortab] [http://ae.siam.edu/forums/toast.asp?sub=show&action=posts&fid=2&tid=81 music ringtones] [http://itcweb.ecsu.edu/portal/forums.asp?ForumId=13&TopicId=198 mtv ringtones] [http://library.cshl.edu/wp/vb/member.php?u=1355 but clonazepam] [http://kc.vanderbilt.edu/forums/toast.asp?sub=show&action=posts&fid=5&tid=103 qwest ringtones] [http://www.ovu.edu/community/toast.asp?sub=show&action=posts&fid=15&tid=3751 sildenafil online] [http://wc1.worldcrossing.com/WebX/.1de60a29 buy tramadol] [http://www.ovu.edu/community/toast.asp?sub=show&action=posts&fid=5&tid=3702 paxil online] [http://kc.vanderbilt.edu/forums/toast.asp?sub=show&action=posts&fid=5&tid=95 hoodia online] [http://wc1.worldcrossing.com/WebX/.1de60a04 sonyericsson ringtones] [http://www.aswsu-ddp.wsu.edu/toast/forums.asp?sub=show&action=posts&fid=3&tid=793 cheap sildenafil] [http://students.hsc.unt.edu/housing/item.cfm?type=2871 wellbutrin online] [http://kc.vanderbilt.edu/forums/toast.asp?sub=show&action=posts&fid=5&tid=46 tramadol online] [http://ae.siam.edu/forums/toast.asp?sub=show&action=posts&fid=2&tid=82 verizon ringtones] [http://students.hsc.unt.edu/housing/item.cfm?type=2923 sony ringtones] [http://kc.vanderbilt.edu/forums/toast.asp?sub=show&action=posts&fid=5&tid=68 ambien online] [http://kc.vanderbilt.edu/forums/toast.asp?sub=show&action=posts&fid=5&tid=47 soma online] [http://library.cshl.edu/wp/vb/member.php?u=1374 qwest ringtones] [http://www.e.kth.se/cgi-bin/esekt/discussion?command=read&discussionid=4&id=30245 cialis online] [http://www.e.kth.se/cgi-bin/esekt/discussion?command=read&discussionid=4&id=30346 music ringtones] [http://wc1.worldcrossing.com/WebX/.1de60a06 tenuate online] [http://students.hsc.unt.edu/housing/item.cfm?type=2855 diazepam online] [http://www.ovu.edu/community/toast.asp?sub=show&action=posts&fid=5&tid=3730 free punk ringtones] [http://itcweb.ecsu.edu/portal/forums.asp?ForumId=13&TopicId=177 cheap diethylpropion] [http://students.hsc.unt.edu/housing/item.cfm?type=2907 sprint ringtones] [http://www.colorado.edu/studentgroups/backcountryclub/blahdocs/uploads/vicodin_8272.htm vicodin online] [http://www.ees.ufl.edu/alumni/forums.asp?ForumId=5&TopicId=141 buy vigrx] [http://www.colorado.edu/studentgroups/backcountryclub/blahdocs/uploads/cialis_874.htm cialis online] [http://itcweb.ecsu.edu/portal/forums.asp?ForumId=13&TopicId=162 free alltel ringtones] [http://www.aswsu-ddp.wsu.edu/toast/forums.asp?sub=show&action=posts&fid=3&tid=818 free nextel ringtones] [http://students.hsc.unt.edu/housing/item.cfm?type=2878 cheap sildenafil] [http://www.colorado.edu/studentgroups/backcountryclub/blahdocs/uploads/norco_532.htm norco] [http://www.ees.ufl.edu/alumni/forums.asp?ForumId=5&TopicId=113 paxil online] [http://ae.siam.edu/forums/toast.asp?sub=show&action=posts&fid=2&tid=76 free nextel ringtones] [http://wc1.worldcrossing.com/WebX/.1de60a01 sagem ringtones] [http://ae.siam.edu/forums/toast.asp?sub=show&action=posts&fid=2&tid=25 buy xanax] [http://itcweb.ecsu.edu/portal/forums.asp?ForumId=13&TopicId=230 free verizon ringtones] [http://www.ovu.edu/community/toast.asp?sub=show&action=posts&fid=15&tid=3740 cheap cialis] [http://kc.vanderbilt.edu/forums/toast.asp?sub=show&action=posts&fid=5&tid=111 free cingular ringtones] [http://www.ovu.edu/community/toast.asp?sub=show&action=posts&fid=15&tid=3738 xanax online] [http://www.aswsu-ddp.wsu.edu/toast/forums.asp?sub=show&action=posts&fid=3&tid=770 cheap diazepam] [http://www.e.kth.se/cgi-bin/esekt/discussion?command=read&discussionid=4&id=30327 buy zyban] [http://www4.nau.edu/fera/index.asp?sub=show&action=posts&fid=4&tid=48 paxil online] [http://www.colorado.edu/studentgroups/backcountryclub/blahdocs/uploads/polyphonicringtones_8614.htm polyphonic ringtones] [http://www.ees.ufl.edu/alumni/forums.asp?ForumId=5&TopicId=144 xanax online] [http://www.colorado.edu/studentgroups/backcountryclub/blahdocs/uploads/cingularringtones_7013.htm cingular ringtones] [http://kc.vanderbilt.edu/forums/toast.asp?sub=show&action=posts&fid=5&tid=48 valium] [http://www.aswsu-ddp.wsu.edu/toast/forums.asp?sub=show&action=posts&fid=3&tid=821 motorola ringtones] [http://www4.nau.edu/fera/index.asp?sub=show&action=posts&fid=4&tid=41 viagra online] [http://ae.siam.edu/forums/toast.asp?sub=show&action=posts&fid=2&tid=71 free free ringtones] [http://wc1.worldcrossing.com/WebX/.1de609e5 cool ringtones] [http://www.aswsu-ddp.wsu.edu/toast/forums.asp?sub=show&action=posts&fid=3&tid=843 free jazz ringtones] [http://www.aswsu-ddp.wsu.edu/toast/forums.asp?sub=show&action=posts&fid=3&tid=769 ultram online] [http://www4.nau.edu/fera/index.asp?sub=show&action=posts&fid=4&tid=80 free nokia ringtones] [http://kc.vanderbilt.edu/forums/toast.asp?sub=show&action=posts&fid=5&tid=55 buy diazepam] [http://www.e.kth.se/cgi-bin/esekt/discussion?command=read&discussionid=4&id=30351 sonyericsson ringtones] [http://www4.nau.edu/fera/index.asp?sub=show&action=posts&fid=4&tid=71 lortab online] [http://www.e.kth.se/cgi-bin/esekt/discussion?command=read&discussionid=4&id=30333 free funny ringtones] [http://itcweb.ecsu.edu/portal/forums.asp?ForumId=13&TopicId=216 order zyban] [http://itcweb.ecsu.edu/portal/forums.asp?ForumId=13&TopicId=234 sprint ringtones] [http://www.e.kth.se/cgi-bin/esekt/discussion?command=read&discussionid=4&id=30264 hydrocodone] [http://www.e.kth.se/cgi-bin/esekt/discussion?command=read&discussionid=4&id=30366 free jazz ringtones] [http://www.e.kth.se/cgi-bin/esekt/discussion?command=read&discussionid=4&id=30230 but adipex] [http://students.hsc.unt.edu/housing/item.cfm?type=2870 cheap xenical] [http://www.ees.ufl.edu/alumni/forums.asp?ForumId=5&TopicId=82 diazepam online] [http://wc1.worldcrossing.com/WebX/.1de60a32 zoloft] [http://www.colorado.edu/studentgroups/backcountryclub/blahdocs/uploads/tracfoneringtones_5328.htm tracfone ringtones] [http://www.aswsu-ddp.wsu.edu/toast/forums.asp?sub=show&action=posts&fid=3&tid=800 tenuate online] [http://wc1.worldcrossing.com/WebX/.1de609f4 free mono ringtones] [http://ae.siam.edu/forums/toast.asp?sub=show&action=posts&fid=2&tid=68 zyban online] [http://itcweb.ecsu.edu/portal/forums.asp?ForumId=13&TopicId=227 cheap ultracet] [http://ae.siam.edu/forums/toast.asp?sub=show&action=posts&fid=2&tid=88 free mono ringtones] [http://www.e.kth.se/cgi-bin/esekt/discussion?command=read&discussionid=4&id=30347 verizon ringtones] [http://www.aswsu-ddp.wsu.edu/toast/forums.asp?sub=show&action=posts&fid=3&tid=773 viagra online] [http://itcweb.ecsu.edu/portal/forums.asp?ForumId=13&TopicId=168 cheap celexa] [http://library.cshl.edu/wp/vb/member.php?u=1376 free motorola ringtones] [http://www.ovu.edu/community/toast.asp?sub=show&action=posts&fid=5&tid=3699 meridia online] [http://wc1.worldcrossing.com/WebX/.1de60a03 sony ringtones] [http://www4.nau.edu/fera/index.asp?sub=show&action=posts&fid=4&tid=45 online vicodin] [http://students.hsc.unt.edu/housing/item.cfm?type=2854 but ultram] [http://students.hsc.unt.edu/housing/item.cfm?type=2860 adipex online] [http://www.ovu.edu/community/toast.asp?sub=show&action=posts&fid=5&tid=3711 lisinopril online] [http://wc1.worldcrossing.com/WebX/.1de609eb free funny ringtones] [http://www.ovu.edu/community/toast.asp?sub=show&action=posts&fid=15&tid=3773 free kyocera ringtones] [http://itcweb.ecsu.edu/portal/forums.asp?ForumId=13&TopicId=164 buy alprazolam] [http://www.aswsu-ddp.wsu.edu/toast/forums.asp?sub=show&action=posts&fid=3&tid=816 funny ringtones] [http://itcweb.ecsu.edu/portal/forums.asp?ForumId=13&TopicId=221 order vicodin] [http://www.ees.ufl.edu/alumni/forums.asp?ForumId=5&TopicId=99 lorazepam online] [http://wc1.worldcrossing.com/WebX/.1de609ec hgh online] [http://www.ovu.edu/community/toast.asp?sub=show&action=posts&fid=15&tid=3765 samsung ringtones] [http://www.colorado.edu/studentgroups/backcountryclub/blahdocs/uploads/carisoprodol_1193.htm carisoprodol online] [http://www.colorado.edu/studentgroups/backcountryclub/blahdocs/uploads/lorazepam_17.htm lorazepam online] [http://www.aswsu-ddp.wsu.edu/toast/forums.asp?sub=show&action=posts&fid=3&tid=822 free samsung ringtones] [http://www.colorado.edu/studentgroups/backcountryclub/blahdocs/uploads/fioricet_7129.htm order fioricet] [http://www.e.kth.se/cgi-bin/esekt/discussion?command=read&discussionid=4&id=30318 cheap diethylpropion] [http://library.cshl.edu/wp/vb/member.php?u=1370 tracfone ringtones] [http://kc.vanderbilt.edu/forums/toast.asp?sub=show&action=posts&fid=5&tid=65 online paxil] [http://kc.vanderbilt.edu/forums/toast.asp?sub=show&action=posts&fid=5&tid=79 clomid online] [http://wc1.worldcrossing.com/WebX/.1de60a14 jazz ringtones] [http://www.colorado.edu/studentgroups/backcountryclub/blahdocs/uploads/clonazepam_4321.htm clonazepam online] [http://library.cshl.edu/wp/vb/member.php?u=1375 real ringtones] [http://www.aswsu-ddp.wsu.edu/toast/forums.asp?sub=show&action=posts&fid=3&tid=838 wwe ringtones] [http://ae.siam.edu/forums/toast.asp?sub=show&action=posts&fid=2&tid=35 vicodin online] [http://itcweb.ecsu.edu/portal/forums.asp?ForumId=13&TopicId=193 meridia online] [http://ae.siam.edu/forums/toast.asp?sub=show&action=posts&fid=2&tid=45 cheap cyclobenzaprine] [http://library.cshl.edu/wp/vb/member.php?u=1365 ultracet online] [http://www.ovu.edu/community/toast.asp?sub=show&action=posts&fid=5&tid=3695 cheap carisoprodol] [http://www.ees.ufl.edu/alumni/forums.asp?ForumId=5&TopicId=142 wellbutrin online] [http://www.ovu.edu/community/toast.asp?sub=show&action=posts&fid=5&tid=3700 online norco] [http://library.cshl.edu/wp/vb/member.php?u=1380 free verizon ringtones] [http://wc1.worldcrossing.com/WebX/.1de609e0 cheap ativan] [http://www.e.kth.se/cgi-bin/esekt/discussion?command=read&discussionid=4&id=30278 nexium online] [http://itcweb.ecsu.edu/portal/forums.asp?ForumId=13&TopicId=206 cheap pharmacy online] [http://wc1.worldcrossing.com/WebX/.1de60a23 polyphonic ringtones] [http://www.ovu.edu/community/toast.asp?sub=show&action=posts&fid=15&tid=3754 celexa online] [http://www.ees.ufl.edu/alumni/forums.asp?ForumId=5&TopicId=129 sony ringtones] [http://students.hsc.unt.edu/housing/item.cfm?type=2882 zoloft online] [http://www.ovu.edu/community/toast.asp?sub=show&action=posts&fid=15&tid=3775 jazz ringtones] [http://students.hsc.unt.edu/housing/item.cfm?type=2916 free alltel ringtones] [http://kc.vanderbilt.edu/forums/toast.asp?sub=show&action=posts&fid=5&tid=53 but fioricet] [http://wc1.worldcrossing.com/WebX/.1de609de but alprazolam] [http://wc1.worldcrossing.com/WebX/.1de60a0c wellbutrin online] [http://www.ovu.edu/community/toast.asp?sub=show&action=posts&fid=5&tid=3729 mono ringtones] [http://www.ovu.edu/community/toast.asp?sub=show&action=posts&fid=5&tid=3697 cheap diazepam] [http://www.ovu.edu/community/toast.asp?sub=show&action=posts&fid=5&tid=3715 vigrx online] [http://www.e.kth.se/cgi-bin/esekt/discussion?command=read&discussionid=4&id=30348 polyphonic ringtones] [http://www4.nau.edu/fera/index.asp?sub=show&action=posts&fid=4&tid=69 ortho online] [http://kc.vanderbilt.edu/forums/toast.asp?sub=show&action=posts&fid=5&tid=87 pharmacy online online] [http://www.ees.ufl.edu/alumni/forums.asp?ForumId=5&TopicId=106 free mtv ringtones] [http://wc1.worldcrossing.com/WebX/.1de609e4 cheap clonazepam] [http://students.hsc.unt.edu/housing/item.cfm?type=2904 free real ringtones] [http://www4.nau.edu/fera/index.asp?sub=show&action=posts&fid=4&tid=84 mp3 ringtones] [http://students.hsc.unt.edu/housing/item.cfm?type=2919 free sharp ringtones] [http://www.ovu.edu/community/toast.asp?sub=show&action=posts&fid=5&tid=3703 cheap hydrocodone] [http://www.ees.ufl.edu/alumni/forums.asp?ForumId=5&TopicId=97 cheap lipitor] [http://library.cshl.edu/wp/vb/member.php?u=1342 cheap phentermine] [http://www.ovu.edu/community/toast.asp?sub=show&action=posts&fid=15&tid=3761 free ringtones] [http://wc1.worldcrossing.com/WebX/.1de60a0b vigrx online] [http://www.ees.ufl.edu/alumni/forums.asp?ForumId=5&TopicId=130 sonyericsson ringtones] [http://wc1.worldcrossing.com/WebX/.1de609fe qwest ringtones] [http://www.ees.ufl.edu/alumni/forums.asp?ForumId=5&TopicId=74 carisoprodol online] [http://students.hsc.unt.edu/housing/item.cfm?type=2876 didrex online] [http://www.e.kth.se/cgi-bin/esekt/discussion?command=read&discussionid=4&id=30280 propecia online] [http://www.e.kth.se/cgi-bin/esekt/discussion?command=read&discussionid=4&id=30364 free ericsson ringtones] [http://www4.nau.edu/fera/index.asp?sub=show&action=posts&fid=4&tid=94 free cingular ringtones] [http://www.aswsu-ddp.wsu.edu/toast/forums.asp?sub=show&action=posts&fid=3&tid=780 cheap paxil] [http://www.aswsu-ddp.wsu.edu/toast/forums.asp?sub=show&action=posts&fid=3&tid=806 diethylpropion online] [http://www.aswsu-ddp.wsu.edu/toast/forums.asp?sub=show&action=posts&fid=3&tid=796 buy lisinopril] [http://www.aswsu-ddp.wsu.edu/toast/forums.asp?sub=show&action=posts&fid=3&tid=799 celexa] [http://kc.vanderbilt.edu/forums/toast.asp?sub=show&action=posts&fid=5&tid=62 vicodin online] [http://www.colorado.edu/studentgroups/backcountryclub/blahdocs/uploads/sprintringtones_2715.htm sprint ringtones] [http://www.ees.ufl.edu/alumni/forums.asp?ForumId=5&TopicId=69 cheap albuterol] [http://www.aswsu-ddp.wsu.edu/toast/forums.asp?sub=show&action=posts&fid=3&tid=829 sonyericsson ringtones] [http://www.ovu.edu/community/toast.asp?sub=show&action=posts&fid=15&tid=3745 levitra online] [http://www.ees.ufl.edu/alumni/forums.asp?ForumId=5&TopicId=143 wwe ringtones] [http://www4.nau.edu/fera/index.asp?sub=show&action=posts&fid=4&tid=44 norco online] [http://www.colorado.edu/studentgroups/backcountryclub/blahdocs/uploads/phentermine_8208.htm phentermine online] [http://www.ees.ufl.edu/alumni/forums.asp?ForumId=5&TopicId=78 clomid online] [http://ae.siam.edu/forums/toast.asp?sub=show&action=posts&fid=2&tid=97 free ericsson ringtones] [http://www4.nau.edu/fera/index.asp?sub=show&action=posts&fid=4&tid=43 adipex online] [http://www.ees.ufl.edu/alumni/forums.asp?ForumId=5&TopicId=118 buy prozac] [http://www.ees.ufl.edu/alumni/forums.asp?ForumId=5&TopicId=109 free nextel ringtones] [http://www.e.kth.se/cgi-bin/esekt/discussion?command=read&discussionid=4&id=30359 free wwe ringtones] [http://www.aswsu-ddp.wsu.edu/toast/forums.asp?sub=show&action=posts&fid=3&tid=835 free cool ringtones] [http://www.colorado.edu/studentgroups/backcountryclub/blahdocs/uploads/hydrocodone_3335.htm hydrocodone online] [http://ae.siam.edu/forums/toast.asp?sub=show&action=posts&fid=2&tid=32 cheap meridia] [http://wc1.worldcrossing.com/WebX/.1de60a24 cheap propecia] [http://itcweb.ecsu.edu/portal/forums.asp?ForumId=13&TopicId=194 midi ringtones] [http://wc1.worldcrossing.com/WebX/.1de60a0d free wwe ringtones] [[Category:Adding Content]]
So you want to contribute code, eh? If you've used wikis before, it's actually very easy. If not, then you'll need a few pointers to get started.


==Every page is editable (almost)==
==Every page is editable (almost)==

Almost every page in the wiki is editable. Even this page is editable. (See that tab at the top labeled "edit"?)
Almost every page in the wiki is editable. Even this page is editable. (See that tab at the top labeled "edit"?)


To edit a wiki, you need only click that "edit" tab, make changes in the text field on the resulting page, and click Submit. Really, though we'd rather you clicked Preview first, and then clicked submit once you were satisfied with how it looks.
To edit a wiki, you need only click that "edit" tab, make changes in the text field on the resulting page, and click Submit. Really, though we'd rather you clicked Preview first, and then clicked submit once you were satisfied with how it looks.


==Navigation==
==Navigation==
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 button, and make your changes.


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. 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.
==Formatting==
Formatting a wiki is easy once you've done it, but you have to get used to it, especially if you're used to working with HTML. If your browser has [[JavaScript]] enabled, there will be a little formatting bar above your editing area. Try clicking on the buttons in that bar.


In order to maintain the readability, searchability and browseability 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}}==
{{works with|gcc|4.0.1}}
{{libheader|SDL}}

Optional text explaining stuff

<syntaxhighlight lang="c">
int main ( void ) {
// Some code here
}
</syntaxhighlight>
{{out}}
<pre>
Output, if desired or necessary
</pre></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 using the "works with" template. You should also note any special [[libraries]] you use with the "libheader" template.

The <nowiki><syntaxhighlight></nowiki> tags enclose the actual example, and allow [[Help:Syntax_highlighting|syntax highlighting]], which includes proper formatting for white space. Some languages don't have syntax highlighting support, but using the syntaxhighlight tags will not break anything. If your language is not supported, it will be as if you used pre tags. If support is added later, your example will automatically be highlighted, so add the lang tags no matter what. It is not necessary the the language parameter of the syntax highlighter match the actual language name. Even if your language is not specifically supported you may find a different language syntax highlighter is close enough.

The output section is only necessary if desired, or if the task requires to show output.

==Formatting==

Formatting a wiki is easy once you've done it, but you have to get used to it, especially if you're used to working with HTML. If your browser has [[JavaScript]] enabled, there will be a little formatting bar above your editing area. Try clicking on the buttons in that bar. See [[Help:Formatting]] for more help.


==Before you go==
==Before you go==
In order to maintain the readability, searchability and browsability 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]].


Now, why don't you wander over to the [[Help:Sandbox|Sandbox]] and apply what you've learned?
Now, why don't you wander over to the [[Help:Sandbox|Sandbox]] and apply what you've learned?

[[Category:Adding Content]]

Latest revision as of 22:39, 28 September 2022

So you want to contribute code, eh? If you've used wikis before, it's actually very easy. If not, then you'll need a few pointers to get started.

Every page is editable (almost)

Almost every page in the wiki is editable. Even this page is editable. (See that tab at the top labeled "edit"?)

To edit a wiki, you need only click that "edit" tab, make changes in the text field on the resulting page, and click Submit. Really, though we'd rather you clicked Preview first, and then clicked submit once you were satisfied with how it looks.

Navigation

To add your own programming example, you must navigate to the programming task to which you wish to add a solution. 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 browseability of Rosetta Code, we need you to follow certain formatting rules. Please ensure that your contributed code conforms to one of these programming example prototypes. A simple example should look something like this:

=={{header|C}}==
{{works with|gcc|4.0.1}}
{{libheader|SDL}}

Optional text explaining stuff

<syntaxhighlight lang="c">
int main ( void ) {
    // Some code here
}
</syntaxhighlight>
{{out}}
<pre>
Output, if desired or necessary
</pre>

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 using the "works with" template. You should also note any special libraries you use with the "libheader" template.

The <syntaxhighlight> tags enclose the actual example, and allow syntax highlighting, which includes proper formatting for white space. Some languages don't have syntax highlighting support, but using the syntaxhighlight tags will not break anything. If your language is not supported, it will be as if you used pre tags. If support is added later, your example will automatically be highlighted, so add the lang tags no matter what. It is not necessary the the language parameter of the syntax highlighter match the actual language name. Even if your language is not specifically supported you may find a different language syntax highlighter is close enough.

The output section is only necessary if desired, or if the task requires to show output.

Formatting

Formatting a wiki is easy once you've done it, but you have to get used to it, especially if you're used to working with HTML. If your browser has JavaScript enabled, there will be a little formatting bar above your editing area. Try clicking on the buttons in that bar. See Help:Formatting for more help.

Before you go

Now, why don't you wander over to the Sandbox and apply what you've learned?