Giter Club home page Giter Club logo

cpp-koans's Introduction

C++ Koans

This repository exists as a set of C++ koans. A koan in general terms is:

a story, dialogue, question, or statement, which is used in Zen practice to provoke the "great doubt" and test a student's progress in Zen practice. [Wikipedia]

In programming terms, a koan is expressed as a series of programming questions written as failing unit test assertions. You progress through the koan by modifying the code to make the assertions pass. By answering the questions it is hoped that you achieve "enlightenment" about the feature in question.

Organization

This repository is organized as a set of source files, each representing a particular area of study in koan form. Each koan corresponds to a unit test executable described by the CMake build script. There is an associated header file for each koan that contains just enough infrastructure to express the koans. You can safely ignore this header file if you are only interested in consuming the koans as a student. If you are interested in writing new koans, you may find useful tricks inside those header files.

Current list of koans.

Practicing the Koans

Each koan consists of a number of test cases. Each test case consists of a number of related statements posed as assertions. Initially all the assertions fail. To practice the koan, edit each assertion to make the assertion true. Typically each assertion will contain the symbol XXX or xxx representing the portion you edit to make the assertion true.

A koan is designed to increase your understanding in some way; it is not a test. Feel free to consult documentation, leverage your IDE to research function signatures, etc., in order to figure out how to make an assertion pass. Sometimes running the tests will tell you how the right answer compared to your incorrect answer. Feel free to copy/paste correct answers from the build output to pass the assertion!

The build script is configured to run the tests after a successful compile, so simply building the code will run the tests and report failed assertions.

First Time Setup

  1. Obtain the dependencies and install them appropriately.
  2. Generate a suitable project/build script with CMake.
  3. Build the code to validate that your dependencies and build are correctly configured and working. You should see the code being compiled and the unit test executables being run after compilation.

Dependencies

  • CMake 3.8.0 for the build infrastructure.
  • Catch2 for the unit test framework. Catch2 is included in the cpp-koans repository, so there is nothing to download.

Contributing

New koans or improvements to existing koans are most welcome! Simply fork and submit a pull request as usual on github.

cpp-koans's People

Contributors

legalizeadulthood avatar

Watchers

James Cloos 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.