// Copyright 2018-2022 David Robillard // SPDX-License-Identifier: GPL-2.0-or-later #include "chilbert/chilbert.hpp" #include #include #include #include #include #include int main(int argc, char** argv) { if (argc != 2) { fprintf(stderr, "Usage: %s NUM_POINTS\n", argv[0]); return 1; } const unsigned long num_points = std::strtoul(argv[1], nullptr, 10); if (num_points == 0 || num_points == ULONG_MAX) { fprintf(stderr, "Usage: %s NUM_POINTS\n", argv[0]); return 1; } const uint32_t w = static_cast(sqrt(1U << static_cast(ceil( log2(static_cast(num_points)))))) - 1U; // Header printf("\n", w, w); printf("Hilbert Curve\n"); printf("\n\n"); return 0; }