Coder Social home page Coder Social logo

0xwaleed / c-scratch Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 1.0 67 KB

Essential programming tasks from scratch as a challenge and exercise. ๐Ÿงฉ

License: MIT License

CMake 6.92% C 43.70% C++ 49.39%
scratch c programming tasks learning excercise

c-scratch's Introduction

Top Langs Anurag's github stats

c-scratch's People

Contributors

0xwaleed avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

sachin-vinod

c-scratch's Issues

RC4 algorithm implementation in C

RC4 Encryption

Description:

Write the RC4 algorithm to encrypt/decrypt data.

Details:

Header:

src/include/rc4.h

Source file:

src/rc4.c

Test file:

tests/rc4.test.cpp

Signature:

void rc4(const char* key, size_t keyLength, const char* plain, size_t plainLength, char* result);

Test Cases:

  1. Input: key: "h" plain: "foo", output: result: "\xc7\x22\xc7"
  2. Input: key: "secret" plain: "foo", output: result: "\x8b\x59\xbd"

Restriction:

  • Do not use any builtin string functions.
  • Only allowed to use memory functions ex: malloc, calloc, etc.

Note:

See Contribution Guide for more details.

Let me know if you are unable to write the tests, I will do that for you.

Also if you want any help let me know ๐Ÿ˜‰.

Factorial Implementation.

Factorial

Description:

Write a simple factorial function.

Details:

Header:

src/include/factorial.h

Source file:

src/factorial.c

Test file:

tests/factorial.test.cpp

Signature:

uint64_t factorial(uint32_t number);

Restriction:

  • Do not use any builtin string functions.
  • Only allowed to use memory functions ex: malloc, calloc, etc.

Note:

See Contribution Guide for more details.

Let me know if you are unable to write the tests, I will do that for you.

Also if you want any help let me know ๐Ÿ˜‰.

Find and Replace text in c

Find and Replace Text

Description:

We need to write a function to replace the first found occurrence

in the input with the given replacement text.

Details:

Header:

src/include/string_replace.h

Source file:

src/string_replace.c

Test file:

tests/string_replace.test.cpp

Signature:

char* string_replace_first_occurence(const char* text, const char* replacement, const char* input);

Restriction:

  • Do not use any builtin string functions.
  • Only allowed to use memory functions ex: malloc, calloc, etc.

Note:

See Contribution Guide for more details.

Let me know if you are unable to write the tests, I will do that for you.

Also if you want any help let me know ๐Ÿ˜‰.

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.