Sample Programs Template

April 13, 2022 ยท View on GitHub

Since early 2018, I've been managing a repository called Sample Programs. The goal of that project was to create a repository containing as many code snippets in as many programming languages as possible. As the repo grew, we added many features to it including automated testing, README generation, and wiki generation. All of that comes together now in a template where you can implement solutions in whatever programming languages you like. Feel free to use this template to track your learning or demonstrate your knowledge. It may well serve as a solid portfolio for you someday. If you have any questions about how to use this template, check out the contributing document in the Sample Programs repo. With that said, let's talk about what this template supports.

Programming Languages

Unlike the Sample Programs repo, the Sample Programs template repo only supports languages with an official Docker image for testing. As a result, here is the official list of supported programming languages:

LanguageDocumentationImageNaming Convention
CDocumentationgcchyphen
C ++Documentationgcchyphen
Gogolanghyphen
JavaDocumentationopenjdkpascal
PythonDocumentationpythonunderscore
RubyDocumentationrubyhyphen

In the table above, you might have noticed the naming convention column. The terms in that column indicate the expected naming convention of the code files for the associated language. For example, files in Java are expected to be named in pascal case (e.g., HelloWorld.java). Below you'll find a list of all the possible naming conventions with examples:

  • hyphen (default): hello-world.lang
  • pascal: HelloWorld.lang
  • underscore: hello_world.lang

See the default naming convention column in the projects table below for the proper naming convention for each project.

Projects

Like the Sample Programs repo, the Sample Programs template repo only supports projects that have documentation and testing. As a result, here is the official list of supported projects:

ProjectRequirementsDefault Naming Convention
BaklavaRequirementsbaklava
Binary SearchRequirementsbinary-search
Bubble SortRequirementsbubble-sort
CapitalizeRequirementscapitalize
Convex HullRequirementsconvex-hull
Even/OddRequirementseven-odd
FactorialRequirementsfactorial
FibonacciRequirementsfibonacci
File IORequirementsfile-io
Fizz BuzzRequirementsfizz-buzz
Hello WorldRequirementshello-world
Insertion SortRequirementsinsertion-sort
Job SequencingRequirementsjob-sequencing
Longest Common SubsequenceRequirementslcs
Longest Palindromic SubstringRequirementslps
Linear SearchRequirementslinear-search
Merge SortRequirementsmerge-sort
Minimum Spanning TreeRequirementsmst
Palindromic NumbersRequirementspalindromic-number
Prime NumbersRequirementsprime-number
QuineRequirementsquine
ROT-13Requirementsrot-13
Reverse a StringRequirementsreverse-string
Roman Numeral ConversionRequirementsroman-numeral
Selection SortRequirementsselection-sort
Sleep SortRequirementssleep-sort

As always, if you're interested in how this projects are tested, check out the official documentation.