{"id":19534897,"url":"https://github.com/newyaroslav/trit_array_cpp","last_synced_at":"2025-09-12T10:36:32.373Z","repository":{"id":162735417,"uuid":"207287824","full_name":"NewYaroslav/trit_array_cpp","owner":"NewYaroslav","description":"C++ header-only library of a trit array","archived":false,"fork":false,"pushed_at":"2019-10-07T09:46:38.000Z","size":20,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-08T17:52:14.047Z","etag":null,"topics":["array","cpp","header-only","three-valued-logic","trilean","trilean-array","trinary","trit","trits"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/NewYaroslav.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-09-09T10:53:50.000Z","updated_at":"2019-10-07T09:46:40.000Z","dependencies_parsed_at":null,"dependency_job_id":"814cb1e7-5172-4c43-9aab-bd0ff8de0fc5","html_url":"https://github.com/NewYaroslav/trit_array_cpp","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NewYaroslav%2Ftrit_array_cpp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NewYaroslav%2Ftrit_array_cpp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NewYaroslav%2Ftrit_array_cpp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NewYaroslav%2Ftrit_array_cpp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NewYaroslav","download_url":"https://codeload.github.com/NewYaroslav/trit_array_cpp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240788749,"owners_count":19857696,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["array","cpp","header-only","three-valued-logic","trilean","trilean-array","trinary","trit","trits"],"created_at":"2024-11-11T02:16:29.327Z","updated_at":"2025-02-26T03:46:23.963Z","avatar_url":"https://github.com/NewYaroslav.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# trit_array_cpp\nC++ header-only library of a trit array\n\n### Description and examples\n* trit - ternary digit\n* in balanced ternary, each digit has one of 3 values: −1, 0, or +1\n\n```C++\n#include \u003ciostream\u003e\n#include \"trit_array.hpp\"\n\nint main() {\n\tstd::cout \u003c\u003c \"Hello world!\" \u003c\u003c std::endl;\n\n\t// Create a two-dimensional array of trits\n\tbase3::trit_array_2d array_2d;\n\n\t// Set the size of a two-dimensional array\n\tconst int SIZE_X = 1000;\n\tconst int SIZE_Y = 100;\n\t//base3::trit_array_2d array_2d(SIZE_X, SIZE_Y); - this option is also possible\n\tarray_2d = base3::trit_array_2d(SIZE_X,SIZE_Y);\n\n\t// Set the value of the trit\n\tarray_2d.set(55, 34, base3::BASE3_TRUE); // Set +1\n\tarray_2d.set(156, 87, base3::BASE3_FALSE); // Set -1\n\tarray_2d.set(3, 8, base3::BASE3_NULL); // Set 0\n\n\t// Get the value of trit\n\tint state = array_2d.get(55, 34);\n\tif(state == base3::BASE3_TRUE) std::cout \u003c\u003c \"true\" \u003c\u003c std::endl;\n\n\t// size of two-dimensional array of trit\n\tint data_size = array_2d.size();\n\tstd::cout \u003c\u003c \"size: \" \u003c\u003c data_size \u003c\u003c std::endl \u003c\u003c std::flush;\n\n\t// pointer to array data\n\tunsigned char *point_data = array_2d.data();\n\n\t// Initialize a new array of trites with an array of bytes\n\tunsigned char *array_data = new unsigned char[data_size];\n\tstd::copy(point_data, point_data + data_size, array_data);\n\tbase3::trit_array_2d new_array_2d(SIZE_X, SIZE_Y, array_data);\n\n\treturn 0;\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnewyaroslav%2Ftrit_array_cpp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnewyaroslav%2Ftrit_array_cpp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnewyaroslav%2Ftrit_array_cpp/lists"}