• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

LegalizeAdulthood/cpp-koans: C++ Koans

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称:

LegalizeAdulthood/cpp-koans

开源软件地址:

https://github.com/LegalizeAdulthood/cpp-koans

开源编程语言:

C++ 99.9%

开源软件介绍:

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.




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap