Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/itsyakub/scrambler
Rubik's Cube scrambling tool made in C
https://github.com/itsyakub/scrambler
c header-only header-only-library language-c rubik-cube rubiks-cube rubiks-cube-scrambler
Last synced: about 2 months ago
JSON representation
Rubik's Cube scrambling tool made in C
- Host: GitHub
- URL: https://github.com/itsyakub/scrambler
- Owner: itsYakub
- License: mit
- Created: 2023-09-22T06:28:45.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-09-22T09:08:20.000Z (over 1 year ago)
- Last Synced: 2023-09-22T23:48:37.179Z (over 1 year ago)
- Topics: c, header-only, header-only-library, language-c, rubik-cube, rubiks-cube, rubiks-cube-scrambler
- Language: C
- Homepage:
- Size: 5.86 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Scrambler
Single-Header Rubik's cube scrambling library made in C!# Example
```c
#include#define SCRAMBLER_IMPLEMENTATION
#include "scrambler.h"int main(void) {
char* scramble = scrambleGenerateString(scrambleGetConfiguration(MODE_3X3));printf("%s\n", scramble);
free(scramble);
return 0;
}
```# Description
Scrambler is a single-header library for scrambling the twisty puzzles written in C. It's simplicity and design allows to simply drag and drop the `scrambler.h` file into your project and use it however you'd like to! You can use pre-defined configurations and even create your own settings which then scrambler will use to output the desired scramble.# Informations:
- `#define SCRAMBLER_IMPLEMENTATION` - Scrambler is single-header library, and to make it work you need to define the macro `SCRAMBLER_IMPLEMENTATION` somewhere in your code. THIS MACRO MUST BE DEFINED ONLY ONCE, OTHERWISE THE COMPILER WON'T COMPILE THE PROJECT PROPERLY;
- `Heap allocation` - currently the project uses dynamically-allocated string to output the scramble as text. Remember to call the `free()` or `delete` at the end of your program to prevent memory leaks;# Licensing
This project uses the [MIT](https://github.com/itsYakub/Scrambler/blob/main/LICENSE) license.