Giter Site home page Giter Site logo

c's Introduction

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]

c's People

Contributors

wolf99 avatar ryanplusplus avatar 0xbarrett avatar kytrinyx avatar arcuru avatar sunzenshen avatar gamecock avatar hintjens avatar antony-jr avatar lpil avatar deathsec avatar siebenschlaefer avatar jacobmikkelsen avatar core-entin avatar dkinzer avatar petertseng avatar gea-migration avatar joeltaylor avatar erikschierboom avatar kerrizor avatar kdar avatar duffn avatar wgj avatar iam13islucky avatar subpop avatar

Watchers

James Cloos avatar Julian Minde avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.