Skip to content

Latest commit

History

11 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

fumen++

fumen++ is a header only C++ library for encoding and decoding fumen strings, which represent Tetris field states. This project is a C++ port of the original knewjade/tetris-fumen (TypeScript) implementation.

Features

  • Encode and decode fumen strings to and from C++ objects
  • Full support for Tetris field, piece operations, comments, and quiz mode
  • Minimal dependencies (uses only the C++ standard library)
  • Designed for C++17 and later
    └─ This library was originally designed for C++20. If you encounter any bugs when using C++17, please open an issue.

Getting Started

1. Include in Your Project

Clone this repository and add the fumen++ directory to your include path.

# On shell
git clone https://github.com/qluana7/fumen-cpp
# CMakeLists.txttarget_include_directory(<target>PRIVATE<path_to_fumen++>)

2. Decoding a Fumen String

#include<fumen.hpp>
#include<iostream>intmain() {
std::string fumen_code = "v115@vhAAgH";
auto pages = fumen::decode(fumen_code);
for (constauto& page : pages) {
std::cout << page.m_field.to_string() << std::endl;
std::cout << "Comment: " << page.m_comment << std::endl;
}
}

3. Encoding to a Fumen String

#include<fumen.hpp>
#include<iostream>intmain() {
fumen::fumen_page page;
std::string fumen_code = fumen::encode({ page });
std::cout << fumen_code << std::endl;
}

References

License

This project follows the same license as the original repository. See knewjade/tetris-fumen for details.

About

C++ Library for encoding/decoding fumen

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages