Skip to content

mindejulian/c

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

C Build Status

Exercism problems in C

Contributing Guide

Please see the Exercism contributing guide for general contribution tips.

Coding Style

All test and example code should be written using the Linux kernel coding style with 3 space indents and no tabs.

If GNU indent is installed, this can be run on all files by executing indent.sh. On a Mac you can install the package gnu-indent using Homebrew.

To manually run it on a single file, you can execute:

indent -linux -i3 -nut $(file)

If your system does not support the -linux option, you can run the long form command instead:

indent -nbad -bap -nbc -bbo -hnl -br -brs -c33 -cd33 -ncdb -ce -ci4 -cli0 -d0 -di1 -nfc1 -i3 -nut -ip0 -l80 -lp -npcs -nprs -npsl -sai -saf -saw -ncs -nsc -sob -nfca -cp33 -ss -il1 $(file)

See the GNU indent manual for more information.

Exercise Anatomy

Each exercise should be contained in a directory c/exercises/<my exercise> with <my exercise> referring to the name of the exercise. The structure of the directory is as follows:

+-- <my exercise>
    +-- makefile
    +-- src
    |   +-- example.c
    |   +-- example.h | <my exercise>.h
    +-- test
        +-- test_<my exercise>.c
        +-- vendor
            +-- unity.c
            +-- unity.h
            +-- unity_internals.h
  • test - contains the test file test_<my exercise>.c and a vendor directory containing the test harness Unity from ThrowTheSwitch. ThrowTheSwitch has a decent guide on getting started with Unity should you desire a tutorial.

  • src - contains the example files example.c and example.h. These are both skipped by the exercism cli when downloading to the client, so it is imperative that you do not reference the names of the files in your code. If you need to provide a header file example that is necessary to run your tests it should be named <my exercise>.h instead. Please also use include guards in your header files. The tests can be run using the bin/run-tests script which will rename the example.{c|h} files accordingly.

License

The MIT License (MIT)

Copyright (c) 2014 Katrina Owen, [email protected]

About

Exercism exercises in C.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 92.8%
  • Makefile 5.8%
  • Shell 1.3%
  • C++ 0.1%