commit c00dd3d37adf14d4e94b05073a5010e9296f907e Author: Paul Brinkmeier Date: Sat Nov 29 11:25:25 2025 +0100 Init diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..eb5a316 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +target diff --git a/Cargo.lock b/Cargo.lock new file mode 100644 index 0000000..9a071e7 --- /dev/null +++ b/Cargo.lock @@ -0,0 +1,973 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "addr2line" +version = "0.25.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b5d307320b3181d6d7954e663bd7c774a838b8220fe0593c86d9fb09f498b4b" +dependencies = [ + "gimli", +] + +[[package]] +name = "adler2" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa" + +[[package]] +name = "allocator-api2" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" + +[[package]] +name = "backtrace" +version = "0.3.76" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb531853791a215d7c62a30daf0dde835f381ab5de4589cfe7c649d2cbe92bd6" +dependencies = [ + "addr2line", + "cfg-if", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", + "windows-link", +] + +[[package]] +name = "bitflags" +version = "2.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "812e12b5285cc515a9c72a5c1d3b6d46a19dac5acfef5265968c166106e31dd3" + +[[package]] +name = "cassowary" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df8670b8c7b9dae1793364eafadf7239c40d669904660c5960d74cfd80b46a53" + +[[package]] +name = "castaway" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dec551ab6e7578819132c713a93c022a05d60159dc86e7a7050223577484c55a" +dependencies = [ + "rustversion", +] + +[[package]] +name = "cdungeon" +version = "0.1.0" +dependencies = [ + "color-eyre", + "crossterm 0.29.0", + "rand", + "ratatui", +] + +[[package]] +name = "cfg-if" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" + +[[package]] +name = "color-eyre" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5920befb47832a6d61ee3a3a846565cfa39b331331e68a3b1d1116630f2f26d" +dependencies = [ + "backtrace", + "color-spantrace", + "eyre", + "indenter", + "once_cell", + "owo-colors", + "tracing-error", +] + +[[package]] +name = "color-spantrace" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8b88ea9df13354b55bc7234ebcce36e6ef896aca2e42a15de9e10edce01b427" +dependencies = [ + "once_cell", + "owo-colors", + "tracing-core", + "tracing-error", +] + +[[package]] +name = "compact_str" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b79c4069c6cad78e2e0cdfcbd26275770669fb39fd308a752dc110e83b9af32" +dependencies = [ + "castaway", + "cfg-if", + "itoa", + "rustversion", + "ryu", + "static_assertions", +] + +[[package]] +name = "convert_case" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb402b8d4c85569410425650ce3eddc7d698ed96d39a73f941b08fb63082f1e7" +dependencies = [ + "unicode-segmentation", +] + +[[package]] +name = "crossterm" +version = "0.28.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "829d955a0bb380ef178a640b91779e3987da38c9aea133b20614cfed8cdea9c6" +dependencies = [ + "bitflags", + "crossterm_winapi", + "mio", + "parking_lot", + "rustix 0.38.44", + "signal-hook", + "signal-hook-mio", + "winapi", +] + +[[package]] +name = "crossterm" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8b9f2e4c67f833b660cdb0a3523065869fb35570177239812ed4c905aeff87b" +dependencies = [ + "bitflags", + "crossterm_winapi", + "derive_more", + "document-features", + "mio", + "parking_lot", + "rustix 1.1.2", + "signal-hook", + "signal-hook-mio", + "winapi", +] + +[[package]] +name = "crossterm_winapi" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "acdd7c62a3665c7f6830a51635d9ac9b23ed385797f70a83bb8bafe9c572ab2b" +dependencies = [ + "winapi", +] + +[[package]] +name = "darling" +version = "0.20.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc7f46116c46ff9ab3eb1597a45688b6715c6e628b5c133e288e709a29bcb4ee" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.20.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d00b9596d185e565c2207a0b01f8bd1a135483d02d9b7b0a54b11da8d53412e" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn", +] + +[[package]] +name = "darling_macro" +version = "0.20.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc34b93ccb385b40dc71c6fceac4b2ad23662c7eeb248cf10d529b7e055b6ead" +dependencies = [ + "darling_core", + "quote", + "syn", +] + +[[package]] +name = "derive_more" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "093242cf7570c207c83073cf82f79706fe7b8317e98620a47d5be7c3d8497678" +dependencies = [ + "derive_more-impl", +] + +[[package]] +name = "derive_more-impl" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bda628edc44c4bb645fbe0f758797143e4e07926f7ebf4e9bdfbd3d2ce621df3" +dependencies = [ + "convert_case", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "document-features" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4b8a88685455ed29a21542a33abd9cb6510b6b129abadabdcef0f4c55bc8f61" +dependencies = [ + "litrs", +] + +[[package]] +name = "either" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" + +[[package]] +name = "equivalent" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" + +[[package]] +name = "errno" +version = "0.3.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" +dependencies = [ + "libc", + "windows-sys 0.61.2", +] + +[[package]] +name = "eyre" +version = "0.6.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7cd915d99f24784cdc19fd37ef22b97e3ff0ae756c7e492e9fbfe897d61e2aec" +dependencies = [ + "indenter", + "once_cell", +] + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "foldhash" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" + +[[package]] +name = "getrandom" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "899def5c37c4fd7b2664648c28120ecec138e4d395b459e5ca34f9cce2dd77fd" +dependencies = [ + "cfg-if", + "libc", + "r-efi", + "wasip2", +] + +[[package]] +name = "gimli" +version = "0.32.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e629b9b98ef3dd8afe6ca2bd0f89306cec16d43d907889945bc5d6687f2f13c7" + +[[package]] +name = "hashbrown" +version = "0.15.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1" +dependencies = [ + "allocator-api2", + "equivalent", + "foldhash", +] + +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + +[[package]] +name = "indenter" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "964de6e86d545b246d84badc0fef527924ace5134f30641c203ef52ba83f58d5" + +[[package]] +name = "indoc" +version = "2.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "79cf5c93f93228cf8efb3ba362535fb11199ac548a09ce117c9b1adc3030d706" +dependencies = [ + "rustversion", +] + +[[package]] +name = "instability" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "435d80800b936787d62688c927b6490e887c7ef5ff9ce922c6c6050fca75eb9a" +dependencies = [ + "darling", + "indoc", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "itertools" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" +dependencies = [ + "either", +] + +[[package]] +name = "itoa" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" + +[[package]] +name = "lazy_static" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" + +[[package]] +name = "libc" +version = "0.2.177" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2874a2af47a2325c2001a6e6fad9b16a53b802102b528163885171cf92b15976" + +[[package]] +name = "linux-raw-sys" +version = "0.4.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" + +[[package]] +name = "linux-raw-sys" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df1d3c3b53da64cf5760482273a98e575c651a67eec7f77df96b5b642de8f039" + +[[package]] +name = "litrs" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11d3d7f243d5c5a8b9bb5d6dd2b1602c0cb0b9db1621bafc7ed66e35ff9fe092" + +[[package]] +name = "lock_api" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "224399e74b87b5f3557511d98dff8b14089b3dadafcab6bb93eab67d3aace965" +dependencies = [ + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34080505efa8e45a4b816c349525ebe327ceaa8559756f0356cba97ef3bf7432" + +[[package]] +name = "lru" +version = "0.12.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "234cf4f4a04dc1f57e24b96cc0cd600cf2af460d4161ac5ecdd0af8e1f3b2a38" +dependencies = [ + "hashbrown", +] + +[[package]] +name = "memchr" +version = "2.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f52b00d39961fc5b2736ea853c9cc86238e165017a493d1d5c8eac6bdc4cc273" + +[[package]] +name = "miniz_oxide" +version = "0.8.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fa76a2c86f704bdb222d66965fb3d63269ce38518b83cb0575fca855ebb6316" +dependencies = [ + "adler2", +] + +[[package]] +name = "mio" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69d83b0086dc8ecf3ce9ae2874b2d1290252e2a30720bea58a5c6639b0092873" +dependencies = [ + "libc", + "log", + "wasi", + "windows-sys 0.61.2", +] + +[[package]] +name = "object" +version = "0.37.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff76201f031d8863c38aa7f905eca4f53abbfa15f609db4277d44cd8938f33fe" +dependencies = [ + "memchr", +] + +[[package]] +name = "once_cell" +version = "1.21.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" + +[[package]] +name = "owo-colors" +version = "4.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c6901729fa79e91a0913333229e9ca5dc725089d1c363b2f4b4760709dc4a52" + +[[package]] +name = "parking_lot" +version = "0.12.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93857453250e3077bd71ff98b6a65ea6621a19bb0f559a85248955ac12c45a1a" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2621685985a2ebf1c516881c026032ac7deafcda1a2c9b7850dc81e3dfcb64c1" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-link", +] + +[[package]] +name = "paste" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" + +[[package]] +name = "pin-project-lite" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" + +[[package]] +name = "ppv-lite86" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" +dependencies = [ + "zerocopy", +] + +[[package]] +name = "proc-macro2" +version = "1.0.103" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ee95bc4ef87b8d5ba32e8b7714ccc834865276eab0aed5c9958d00ec45f49e8" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.42" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a338cc41d27e6cc6dce6cefc13a0729dfbb81c262b1f519331575dd80ef3067f" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "r-efi" +version = "5.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" + +[[package]] +name = "rand" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6db2770f06117d490610c7488547d543617b21bfa07796d7a12f6f1bd53850d1" +dependencies = [ + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "99d9a13982dcf210057a8a78572b2217b667c3beacbf3a0d8b454f6f82837d38" +dependencies = [ + "getrandom", +] + +[[package]] +name = "ratatui" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eabd94c2f37801c20583fc49dd5cd6b0ba68c716787c2dd6ed18571e1e63117b" +dependencies = [ + "bitflags", + "cassowary", + "compact_str", + "crossterm 0.28.1", + "indoc", + "instability", + "itertools", + "lru", + "paste", + "strum", + "unicode-segmentation", + "unicode-truncate", + "unicode-width 0.2.0", +] + +[[package]] +name = "redox_syscall" +version = "0.5.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed2bf2547551a7053d6fdfafda3f938979645c44812fbfcda098faae3f1a362d" +dependencies = [ + "bitflags", +] + +[[package]] +name = "rustc-demangle" +version = "0.1.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56f7d92ca342cea22a06f2121d944b4fd82af56988c270852495420f961d4ace" + +[[package]] +name = "rustix" +version = "0.38.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdb5bc1ae2baa591800df16c9ca78619bf65c0488b41b96ccec5d11220d8c154" +dependencies = [ + "bitflags", + "errno", + "libc", + "linux-raw-sys 0.4.15", + "windows-sys 0.59.0", +] + +[[package]] +name = "rustix" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd15f8a2c5551a84d56efdc1cd049089e409ac19a3072d5037a17fd70719ff3e" +dependencies = [ + "bitflags", + "errno", + "libc", + "linux-raw-sys 0.11.0", + "windows-sys 0.61.2", +] + +[[package]] +name = "rustversion" +version = "1.0.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d" + +[[package]] +name = "ryu" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "sharded-slab" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" +dependencies = [ + "lazy_static", +] + +[[package]] +name = "signal-hook" +version = "0.3.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d881a16cf4426aa584979d30bd82cb33429027e42122b169753d6ef1085ed6e2" +dependencies = [ + "libc", + "signal-hook-registry", +] + +[[package]] +name = "signal-hook-mio" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b75a19a7a740b25bc7944bdee6172368f988763b744e3d4dfe753f6b4ece40cc" +dependencies = [ + "libc", + "mio", + "signal-hook", +] + +[[package]] +name = "signal-hook-registry" +version = "1.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7664a098b8e616bdfcc2dc0e9ac44eb231eedf41db4e9fe95d8d32ec728dedad" +dependencies = [ + "libc", +] + +[[package]] +name = "smallvec" +version = "1.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" + +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + +[[package]] +name = "strsim" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" + +[[package]] +name = "strum" +version = "0.26.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fec0f0aef304996cf250b31b5a10dee7980c85da9d759361292b8bca5a18f06" +dependencies = [ + "strum_macros", +] + +[[package]] +name = "strum_macros" +version = "0.26.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c6bee85a5a24955dc440386795aa378cd9cf82acd5f764469152d2270e581be" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "rustversion", + "syn", +] + +[[package]] +name = "syn" +version = "2.0.111" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "390cc9a294ab71bdb1aa2e99d13be9c753cd2d7bd6560c77118597410c4d2e87" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "thread_local" +version = "1.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f60246a4944f24f6e018aa17cdeffb7818b76356965d03b07d6a9886e8962185" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "tracing" +version = "0.1.41" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0" +dependencies = [ + "pin-project-lite", + "tracing-core", +] + +[[package]] +name = "tracing-core" +version = "0.1.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a04e24fab5c89c6a36eb8558c9656f30d81de51dfa4d3b45f26b21d61fa0a6c" +dependencies = [ + "once_cell", + "valuable", +] + +[[package]] +name = "tracing-error" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b1581020d7a273442f5b45074a6a57d5757ad0a47dac0e9f0bd57b81936f3db" +dependencies = [ + "tracing", + "tracing-subscriber", +] + +[[package]] +name = "tracing-subscriber" +version = "0.3.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2054a14f5307d601f88daf0553e1cbf472acc4f2c51afab632431cdcd72124d5" +dependencies = [ + "sharded-slab", + "thread_local", + "tracing-core", +] + +[[package]] +name = "unicode-ident" +version = "1.0.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9312f7c4f6ff9069b165498234ce8be658059c6728633667c526e27dc2cf1df5" + +[[package]] +name = "unicode-segmentation" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6ccf251212114b54433ec949fd6a7841275f9ada20dddd2f29e9ceea4501493" + +[[package]] +name = "unicode-truncate" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b3644627a5af5fa321c95b9b235a72fd24cd29c648c2c379431e6628655627bf" +dependencies = [ + "itertools", + "unicode-segmentation", + "unicode-width 0.1.14", +] + +[[package]] +name = "unicode-width" +version = "0.1.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af" + +[[package]] +name = "unicode-width" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fc81956842c57dac11422a97c3b8195a1ff727f06e85c84ed2e8aa277c9a0fd" + +[[package]] +name = "valuable" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65" + +[[package]] +name = "wasi" +version = "0.11.1+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" + +[[package]] +name = "wasip2" +version = "1.0.1+wasi-0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0562428422c63773dad2c345a1882263bbf4d65cf3f42e90921f787ef5ad58e7" +dependencies = [ + "wit-bindgen", +] + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows-link" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" + +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-sys" +version = "0.61.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_gnullvm", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "wit-bindgen" +version = "0.46.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f17a85883d4e6d00e8a97c586de764dabcc06133f7f1d55dce5cdc070ad7fe59" + +[[package]] +name = "zerocopy" +version = "0.8.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ea879c944afe8a2b25fef16bb4ba234f47c694565e97383b36f3a878219065c" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.8.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf955aa904d6040f70dc8e9384444cb1030aed272ba3cb09bbc4ab9e7c1f34f5" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 0000000..2190ef3 --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,10 @@ +[package] +name = "cdungeon" +version = "0.1.0" +edition = "2024" + +[dependencies] +color-eyre = "0.6.5" +crossterm = "0.29.0" +rand = "0.9.2" +ratatui = "0.29.0" diff --git a/design/box-characters.txt b/design/box-characters.txt new file mode 100644 index 0000000..bf146a8 --- /dev/null +++ b/design/box-characters.txt @@ -0,0 +1,186 @@ +⌧ U+2327 X IN A RECTANGLE BOX Miscellaneous Technical +⍽ U+237D SHOULDERED OPEN BOX Miscellaneous Technical +⎸ U+23B8 LEFT VERTICAL BOX LINE Miscellaneous Technical +⎹ U+23B9 RIGHT VERTICAL BOX LINE Miscellaneous Technical +␣ U+2423 OPEN BOX Control Pictures +─ U+2500 BOX DRAWINGS LIGHT HORIZONTAL Box Drawing +━ U+2501 BOX DRAWINGS HEAVY HORIZONTAL Box Drawing +│ U+2502 BOX DRAWINGS LIGHT VERTICAL Box Drawing +┃ U+2503 BOX DRAWINGS HEAVY VERTICAL Box Drawing +┄ U+2504 BOX DRAWINGS LIGHT TRIPLE DASH HORIZONTAL Box Drawing +┅ U+2505 BOX DRAWINGS HEAVY TRIPLE DASH HORIZONTAL Box Drawing +┆ U+2506 BOX DRAWINGS LIGHT TRIPLE DASH VERTICAL Box Drawing +┇ U+2507 BOX DRAWINGS HEAVY TRIPLE DASH VERTICAL Box Drawing +┈ U+2508 BOX DRAWINGS LIGHT QUADRUPLE DASH HORIZONTAL Box Drawing +┉ U+2509 BOX DRAWINGS HEAVY QUADRUPLE DASH HORIZONTAL Box Drawing +┊ U+250A BOX DRAWINGS LIGHT QUADRUPLE DASH VERTICAL Box Drawing +┋ U+250B BOX DRAWINGS HEAVY QUADRUPLE DASH VERTICAL Box Drawing +┌ U+250C BOX DRAWINGS LIGHT DOWN AND RIGHT Box Drawing +┍ U+250D BOX DRAWINGS DOWN LIGHT AND RIGHT HEAVY Box Drawing +┎ U+250E BOX DRAWINGS DOWN HEAVY AND RIGHT LIGHT Box Drawing +┏ U+250F BOX DRAWINGS HEAVY DOWN AND RIGHT Box Drawing +┐ U+2510 BOX DRAWINGS LIGHT DOWN AND LEFT Box Drawing +┑ U+2511 BOX DRAWINGS DOWN LIGHT AND LEFT HEAVY Box Drawing +┒ U+2512 BOX DRAWINGS DOWN HEAVY AND LEFT LIGHT Box Drawing +┓ U+2513 BOX DRAWINGS HEAVY DOWN AND LEFT Box Drawing +└ U+2514 BOX DRAWINGS LIGHT UP AND RIGHT Box Drawing +┕ U+2515 BOX DRAWINGS UP LIGHT AND RIGHT HEAVY Box Drawing +┖ U+2516 BOX DRAWINGS UP HEAVY AND RIGHT LIGHT Box Drawing +┗ U+2517 BOX DRAWINGS HEAVY UP AND RIGHT Box Drawing +┘ U+2518 BOX DRAWINGS LIGHT UP AND LEFT Box Drawing +┙ U+2519 BOX DRAWINGS UP LIGHT AND LEFT HEAVY Box Drawing +┚ U+251A BOX DRAWINGS UP HEAVY AND LEFT LIGHT Box Drawing +┛ U+251B BOX DRAWINGS HEAVY UP AND LEFT Box Drawing +├ U+251C BOX DRAWINGS LIGHT VERTICAL AND RIGHT Box Drawing +┝ U+251D BOX DRAWINGS VERTICAL LIGHT AND RIGHT HEAVY Box Drawing +┞ U+251E BOX DRAWINGS UP HEAVY AND RIGHT DOWN LIGHT Box Drawing +┟ U+251F BOX DRAWINGS DOWN HEAVY AND RIGHT UP LIGHT Box Drawing +┠ U+2520 BOX DRAWINGS VERTICAL HEAVY AND RIGHT LIGHT Box Drawing +┡ U+2521 BOX DRAWINGS DOWN LIGHT AND RIGHT UP HEAVY Box Drawing +┢ U+2522 BOX DRAWINGS UP LIGHT AND RIGHT DOWN HEAVY Box Drawing +┣ U+2523 BOX DRAWINGS HEAVY VERTICAL AND RIGHT Box Drawing +┤ U+2524 BOX DRAWINGS LIGHT VERTICAL AND LEFT Box Drawing +┥ U+2525 BOX DRAWINGS VERTICAL LIGHT AND LEFT HEAVY Box Drawing +┦ U+2526 BOX DRAWINGS UP HEAVY AND LEFT DOWN LIGHT Box Drawing +┧ U+2527 BOX DRAWINGS DOWN HEAVY AND LEFT UP LIGHT Box Drawing +┨ U+2528 BOX DRAWINGS VERTICAL HEAVY AND LEFT LIGHT Box Drawing +┩ U+2529 BOX DRAWINGS DOWN LIGHT AND LEFT UP HEAVY Box Drawing +┪ U+252A BOX DRAWINGS UP LIGHT AND LEFT DOWN HEAVY Box Drawing +┫ U+252B BOX DRAWINGS HEAVY VERTICAL AND LEFT Box Drawing +┬ U+252C BOX DRAWINGS LIGHT DOWN AND HORIZONTAL Box Drawing +┭ U+252D BOX DRAWINGS LEFT HEAVY AND RIGHT DOWN LIGHT Box Drawing +┮ U+252E BOX DRAWINGS RIGHT HEAVY AND LEFT DOWN LIGHT Box Drawing +┯ U+252F BOX DRAWINGS DOWN LIGHT AND HORIZONTAL HEAVY Box Drawing +┰ U+2530 BOX DRAWINGS DOWN HEAVY AND HORIZONTAL LIGHT Box Drawing +┱ U+2531 BOX DRAWINGS RIGHT LIGHT AND LEFT DOWN HEAVY Box Drawing +┲ U+2532 BOX DRAWINGS LEFT LIGHT AND RIGHT DOWN HEAVY Box Drawing +┳ U+2533 BOX DRAWINGS HEAVY DOWN AND HORIZONTAL Box Drawing +┴ U+2534 BOX DRAWINGS LIGHT UP AND HORIZONTAL Box Drawing +┵ U+2535 BOX DRAWINGS LEFT HEAVY AND RIGHT UP LIGHT Box Drawing +┶ U+2536 BOX DRAWINGS RIGHT HEAVY AND LEFT UP LIGHT Box Drawing +┷ U+2537 BOX DRAWINGS UP LIGHT AND HORIZONTAL HEAVY Box Drawing +┸ U+2538 BOX DRAWINGS UP HEAVY AND HORIZONTAL LIGHT Box Drawing +┹ U+2539 BOX DRAWINGS RIGHT LIGHT AND LEFT UP HEAVY Box Drawing +┺ U+253A BOX DRAWINGS LEFT LIGHT AND RIGHT UP HEAVY Box Drawing +┻ U+253B BOX DRAWINGS HEAVY UP AND HORIZONTAL Box Drawing +┼ U+253C BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL Box Drawing +┽ U+253D BOX DRAWINGS LEFT HEAVY AND RIGHT VERTICAL LIGHT Box Drawing +┾ U+253E BOX DRAWINGS RIGHT HEAVY AND LEFT VERTICAL LIGHT Box Drawing +┿ U+253F BOX DRAWINGS VERTICAL LIGHT AND HORIZONTAL HEAVY Box Drawing +╀ U+2540 BOX DRAWINGS UP HEAVY AND DOWN HORIZONTAL LIGHT Box Drawing +╁ U+2541 BOX DRAWINGS DOWN HEAVY AND UP HORIZONTAL LIGHT Box Drawing +╂ U+2542 BOX DRAWINGS VERTICAL HEAVY AND HORIZONTAL LIGHT Box Drawing +╃ U+2543 BOX DRAWINGS LEFT UP HEAVY AND RIGHT DOWN LIGHT Box Drawing +╄ U+2544 BOX DRAWINGS RIGHT UP HEAVY AND LEFT DOWN LIGHT Box Drawing +╅ U+2545 BOX DRAWINGS LEFT DOWN HEAVY AND RIGHT UP LIGHT Box Drawing +╆ U+2546 BOX DRAWINGS RIGHT DOWN HEAVY AND LEFT UP LIGHT Box Drawing +╇ U+2547 BOX DRAWINGS DOWN LIGHT AND UP HORIZONTAL HEAVY Box Drawing +╈ U+2548 BOX DRAWINGS UP LIGHT AND DOWN HORIZONTAL HEAVY Box Drawing +╉ U+2549 BOX DRAWINGS RIGHT LIGHT AND LEFT VERTICAL HEAVY Box Drawing +╊ U+254A BOX DRAWINGS LEFT LIGHT AND RIGHT VERTICAL HEAVY Box Drawing +╋ U+254B BOX DRAWINGS HEAVY VERTICAL AND HORIZONTAL Box Drawing +╌ U+254C BOX DRAWINGS LIGHT DOUBLE DASH HORIZONTAL Box Drawing +╍ U+254D BOX DRAWINGS HEAVY DOUBLE DASH HORIZONTAL Box Drawing +╎ U+254E BOX DRAWINGS LIGHT DOUBLE DASH VERTICAL Box Drawing +╏ U+254F BOX DRAWINGS HEAVY DOUBLE DASH VERTICAL Box Drawing +═ U+2550 BOX DRAWINGS DOUBLE HORIZONTAL Box Drawing +║ U+2551 BOX DRAWINGS DOUBLE VERTICAL Box Drawing +╒ U+2552 BOX DRAWINGS DOWN SINGLE AND RIGHT DOUBLE Box Drawing +╓ U+2553 BOX DRAWINGS DOWN DOUBLE AND RIGHT SINGLE Box Drawing +╔ U+2554 BOX DRAWINGS DOUBLE DOWN AND RIGHT Box Drawing +╕ U+2555 BOX DRAWINGS DOWN SINGLE AND LEFT DOUBLE Box Drawing +╖ U+2556 BOX DRAWINGS DOWN DOUBLE AND LEFT SINGLE Box Drawing +╗ U+2557 BOX DRAWINGS DOUBLE DOWN AND LEFT Box Drawing +╘ U+2558 BOX DRAWINGS UP SINGLE AND RIGHT DOUBLE Box Drawing +╙ U+2559 BOX DRAWINGS UP DOUBLE AND RIGHT SINGLE Box Drawing +╚ U+255A BOX DRAWINGS DOUBLE UP AND RIGHT Box Drawing +╛ U+255B BOX DRAWINGS UP SINGLE AND LEFT DOUBLE Box Drawing +╜ U+255C BOX DRAWINGS UP DOUBLE AND LEFT SINGLE Box Drawing +╝ U+255D BOX DRAWINGS DOUBLE UP AND LEFT Box Drawing +╞ U+255E BOX DRAWINGS VERTICAL SINGLE AND RIGHT DOUBLE Box Drawing +╟ U+255F BOX DRAWINGS VERTICAL DOUBLE AND RIGHT SINGLE Box Drawing +╠ U+2560 BOX DRAWINGS DOUBLE VERTICAL AND RIGHT Box Drawing +╡ U+2561 BOX DRAWINGS VERTICAL SINGLE AND LEFT DOUBLE Box Drawing +╢ U+2562 BOX DRAWINGS VERTICAL DOUBLE AND LEFT SINGLE Box Drawing +╣ U+2563 BOX DRAWINGS DOUBLE VERTICAL AND LEFT Box Drawing +╤ U+2564 BOX DRAWINGS DOWN SINGLE AND HORIZONTAL DOUBLE Box Drawing +╥ U+2565 BOX DRAWINGS DOWN DOUBLE AND HORIZONTAL SINGLE Box Drawing +╦ U+2566 BOX DRAWINGS DOUBLE DOWN AND HORIZONTAL Box Drawing +╧ U+2567 BOX DRAWINGS UP SINGLE AND HORIZONTAL DOUBLE Box Drawing +╨ U+2568 BOX DRAWINGS UP DOUBLE AND HORIZONTAL SINGLE Box Drawing +╩ U+2569 BOX DRAWINGS DOUBLE UP AND HORIZONTAL Box Drawing +╪ U+256A BOX DRAWINGS VERTICAL SINGLE AND HORIZONTAL DOUBLE Box Drawing +╫ U+256B BOX DRAWINGS VERTICAL DOUBLE AND HORIZONTAL SINGLE Box Drawing +╬ U+256C BOX DRAWINGS DOUBLE VERTICAL AND HORIZONTAL Box Drawing +╭ U+256D BOX DRAWINGS LIGHT ARC DOWN AND RIGHT Box Drawing +╮ U+256E BOX DRAWINGS LIGHT ARC DOWN AND LEFT Box Drawing +╯ U+256F BOX DRAWINGS LIGHT ARC UP AND LEFT Box Drawing +╰ U+2570 BOX DRAWINGS LIGHT ARC UP AND RIGHT Box Drawing +╱ U+2571 BOX DRAWINGS LIGHT DIAGONAL UPPER RIGHT TO LOWER LEFT Box Drawing +╲ U+2572 BOX DRAWINGS LIGHT DIAGONAL UPPER LEFT TO LOWER RIGHT Box Drawing +╳ U+2573 BOX DRAWINGS LIGHT DIAGONAL CROSS Box Drawing +╴ U+2574 BOX DRAWINGS LIGHT LEFT Box Drawing +╵ U+2575 BOX DRAWINGS LIGHT UP Box Drawing +╶ U+2576 BOX DRAWINGS LIGHT RIGHT Box Drawing +╷ U+2577 BOX DRAWINGS LIGHT DOWN Box Drawing +╸ U+2578 BOX DRAWINGS HEAVY LEFT Box Drawing +╹ U+2579 BOX DRAWINGS HEAVY UP Box Drawing +╺ U+257A BOX DRAWINGS HEAVY RIGHT Box Drawing +╻ U+257B BOX DRAWINGS HEAVY DOWN Box Drawing +╼ U+257C BOX DRAWINGS LIGHT LEFT AND HEAVY RIGHT Box Drawing +╽ U+257D BOX DRAWINGS LIGHT UP AND HEAVY DOWN Box Drawing +╾ U+257E BOX DRAWINGS HEAVY LEFT AND LIGHT RIGHT Box Drawing +╿ U+257F BOX DRAWINGS HEAVY UP AND LIGHT DOWN Box Drawing +☐ U+2610 BALLOT BOX Miscellaneous Symbols +☑ U+2611 BALLOT BOX WITH CHECK Miscellaneous Symbols +☒ U+2612 BALLOT BOX WITH X Miscellaneous Symbols +⫍ U+2ACD SQUARE LEFT OPEN BOX OPERATOR Supplemental Mathematical Operators +⫎ U+2ACE SQUARE RIGHT OPEN BOX OPERATOR Supplemental Mathematical Operators +⮹ U+2BB9 UP ARROWHEAD IN A RECTANGLE BOX Miscellaneous Symbols and Arrows +⮽ U+2BBD BALLOT BOX WITH LIGHT X Miscellaneous Symbols and Arrows +⺆ U+2E86 CJK RADICAL BOX CJK Radicals Supplement +⼌ U+2F0C KANGXI RADICAL DOWN BOX Kangxi Radicals +⼐ U+2F10 KANGXI RADICAL OPEN BOX Kangxi Radicals +⼕ U+2F15 KANGXI RADICAL RIGHT OPEN BOX Kangxi Radicals +ꀦ U+A026 YI SYLLABLE BOX Yi Syllables +ꁦ U+A066 YI SYLLABLE BBOX Yi Syllables +ꂂ U+A082 YI SYLLABLE NBOX Yi Syllables +𝥂 U+1D942 SIGNWRITING MOVEMENT-WALLPLANE BOX SMALL Sutton SignWriting +𝥃 U+1D943 SIGNWRITING MOVEMENT-WALLPLANE BOX MEDIUM Sutton SignWriting +𝥄 U+1D944 SIGNWRITING MOVEMENT-WALLPLANE BOX LARGE Sutton SignWriting +𝥸 U+1D978 SIGNWRITING MOVEMENT-FLOORPLANE BOX SMALL Sutton SignWriting +𝥹 U+1D979 SIGNWRITING MOVEMENT-FLOORPLANE BOX MEDIUM Sutton SignWriting +𝥺 U+1D97A SIGNWRITING MOVEMENT-FLOORPLANE BOX LARGE Sutton SignWriting +🍱 U+1F371 BENTO BOX Miscellaneous Symbols and Pictographs +📤 U+1F4E4 OUTBOX TRAY Miscellaneous Symbols and Pictographs +📥 U+1F4E5 INBOX TRAY Miscellaneous Symbols and Pictographs +📪 U+1F4EA CLOSED MAILBOX WITH LOWERED FLAG Miscellaneous Symbols and Pictographs +📫 U+1F4EB CLOSED MAILBOX WITH RAISED FLAG Miscellaneous Symbols and Pictographs +📬 U+1F4EC OPEN MAILBOX WITH RAISED FLAG Miscellaneous Symbols and Pictographs +📭 U+1F4ED OPEN MAILBOX WITH LOWERED FLAG Miscellaneous Symbols and Pictographs +📮 U+1F4EE POSTBOX Miscellaneous Symbols and Pictographs +🗃 U+1F5C3 CARD FILE BOX Miscellaneous Symbols and Pictographs +🗳 U+1F5F3 BALLOT BOX WITH BALLOT Miscellaneous Symbols and Pictographs +🗵 U+1F5F5 BALLOT BOX WITH SCRIPT X Miscellaneous Symbols and Pictographs +🗷 U+1F5F7 BALLOT BOX WITH BOLD SCRIPT X Miscellaneous Symbols and Pictographs +🗹 U+1F5F9 BALLOT BOX WITH BOLD CHECK Miscellaneous Symbols and Pictographs +🥊 U+1F94A BOXING GLOVE Supplemental Symbols and Pictographs +🥡 U+1F961 TAKEOUT BOX Supplemental Symbols and Pictographs +🧃 U+1F9C3 BEVERAGE BOX Supplemental Symbols and Pictographs +🧰 U+1F9F0 TOOLBOX Supplemental Symbols and Pictographs +🮠 U+1FBA0 BOX DRAWINGS LIGHT DIAGONAL UPPER CENTRE TO MIDDLE LEFT Symbols for Legacy Computing +🮡 U+1FBA1 BOX DRAWINGS LIGHT DIAGONAL UPPER CENTRE TO MIDDLE RIGHT Symbols for Legacy Computing +🮢 U+1FBA2 BOX DRAWINGS LIGHT DIAGONAL MIDDLE LEFT TO LOWER CENTRE Symbols for Legacy Computing +🮣 U+1FBA3 BOX DRAWINGS LIGHT DIAGONAL MIDDLE RIGHT TO LOWER CENTRE Symbols for Legacy Computing +🮤 U+1FBA4 BOX DRAWINGS LIGHT DIAGONAL UPPER CENTRE TO MIDDLE LEFT TO LOWER CENTRE Symbols for Legacy Computing +🮥 U+1FBA5 BOX DRAWINGS LIGHT DIAGONAL UPPER CENTRE TO MIDDLE RIGHT TO LOWER CENTRE Symbols for Legacy Computing +🮦 U+1FBA6 BOX DRAWINGS LIGHT DIAGONAL MIDDLE LEFT TO LOWER CENTRE TO MIDDLE RIGHT Symbols for Legacy Computing +🮧 U+1FBA7 BOX DRAWINGS LIGHT DIAGONAL MIDDLE LEFT TO UPPER CENTRE TO MIDDLE RIGHT Symbols for Legacy Computing +🮨 U+1FBA8 BOX DRAWINGS LIGHT DIAGONAL UPPER CENTRE TO MIDDLE LEFT AND MIDDLE RIGHT TO LOWER CENTRE Symbols for Legacy Computing +🮩 U+1FBA9 BOX DRAWINGS LIGHT DIAGONAL UPPER CENTRE TO MIDDLE RIGHT AND MIDDLE LEFT TO LOWER CENTRE Symbols for Legacy Computing +🮪 U+1FBAA BOX DRAWINGS LIGHT DIAGONAL UPPER CENTRE TO MIDDLE RIGHT TO LOWER CENTRE TO MIDDLE LEFT Symbols for Legacy Computing +🮫 U+1FBAB BOX DRAWINGS LIGHT DIAGONAL UPPER CENTRE TO MIDDLE LEFT TO LOWER CENTRE TO MIDDLE RIGHT Symbols for Legacy Computing +🮬 U+1FBAC BOX DRAWINGS LIGHT DIAGONAL MIDDLE LEFT TO UPPER CENTRE TO MIDDLE RIGHT TO LOWER CENTRE Symbols for Legacy Computing +🮭 U+1FBAD BOX DRAWINGS LIGHT DIAGONAL MIDDLE RIGHT TO UPPER CENTRE TO MIDDLE LEFT TO LOWER CENTRE Symbols for Legacy Computing +🮮 U+1FBAE BOX DRAWINGS LIGHT DIAGONAL DIAMOND Symbols for Legacy Computing +🮯 U+1FBAF BOX DRAWINGS LIGHT HORIZONTAL WITH VERTICAL STROKE Symbols for Legacy Computing diff --git a/design/v0.txt b/design/v0.txt new file mode 100644 index 0000000..69aee6c --- /dev/null +++ b/design/v0.txt @@ -0,0 +1,42 @@ +Horizontal doors: + ╭─╮ + ╭╮ ╭╮ ├ │ + ╛╘═╛╘═╛ ╘ + + ╭─╮ + ├ │ +═╛ ╘═ + + ╭─╮ + ├ │ +═╩═╩═ + +Vertical doors: + +║ ♦═════════ +╟─┬─╮ ║Documents +╟───╯ +║ ♦═════════ +╟─┬─╮ ║Downloads +╟───╯ +║ ♦════════════ +╟─┬─╮ ║Applications +╟───╯ + +Single-char + + ╔═══════════════════════════════════════════════ + ║ + ☰ 𜱟 🮴 Documents ■ (with background) + + 🮴 Downloads ⬕ blah.json + + 🮴 Applications 🮴 Zomboid + + + + + ⎕ Source ⎕ This folder has a really really really long name + ⎕ Music ⎕ something + + diff --git a/src/geometry.rs b/src/geometry.rs new file mode 100644 index 0000000..9f6fac5 --- /dev/null +++ b/src/geometry.rs @@ -0,0 +1,64 @@ +use std::ops::{Add, Div, Sub}; + +#[derive(Clone, Copy, Debug, PartialEq)] +struct P2 { + x: i32, + y: i32, +} + +impl P2 { + fn new(x: i32, y: i32) -> Self { + Self { x, y } + } +} +impl Add for P2 { + type Output = P2; + + fn add(self, rhs: V2) -> Self::Output { + P2::new(self.x + rhs.x, self.y + rhs.y) + } +} + +impl Sub for P2 { + type Output = V2; + + fn sub(self, rhs: P2) -> Self::Output { + V2::new(self.x - rhs.x, self.y - rhs.y) + } +} + +impl Sub for P2 { + type Output = P2; + + fn sub(self, rhs: V2) -> Self::Output { + P2::new(self.x - rhs.x, self.y - rhs.y) + } +} + +impl Div for P2 { + type Output = P2; + + fn div(self, rhs: i32) -> Self::Output { + Self::new(self.x / rhs, self.y / rhs) + } +} + +#[derive(Debug)] +struct V2 { + x: i32, + y: i32, +} + +impl V2 { + fn new(x: i32, y: i32) -> Self { + Self { x, y } + } +} + +impl Div for V2 { + type Output = V2; + + fn div(self, rhs: i32) -> Self::Output { + V2::new(self.x / rhs, self.y / rhs) + } +} diff --git a/src/main.rs b/src/main.rs new file mode 100644 index 0000000..f457bdc --- /dev/null +++ b/src/main.rs @@ -0,0 +1,29 @@ +use std::cmp::max; + +mod geometry; +mod noise; +mod terrain; + +use noise::Noise; + +fn main() { + let width = 50; + let height = 20; + + let long_side = max(width, height) as f32; + + let mut rand = rand::rng(); + let height_noise = Noise::from_freqs(&mut rand, 12, 16, 3); + let tree_cover_noise = Noise::from_freqs(&mut rand, 12, 16, 4); + + for y in 0..height { + for x in 0..width { + let h = height_noise.sample(x as f32 / long_side, y as f32 / long_side); + let t = tree_cover_noise.sample(x as f32 / long_side, y as f32 / long_side); + + let terrain = terrain::terrain(h, t); + print!("{}", terrain.printable()); + } + println!(); + } +} diff --git a/src/noise.rs b/src/noise.rs new file mode 100644 index 0000000..6b63138 --- /dev/null +++ b/src/noise.rs @@ -0,0 +1,87 @@ +use rand::{Rng, rngs::ThreadRng}; +pub struct Noise { + levels: Vec>, +} + +impl Noise { + pub fn sample(&self, x: f32, y: f32) -> f32 { + let mut s = 0.0; + let mut max_possible = 0.0; + for (i, level) in self.levels.iter().enumerate() { + let f = 1.0 / 2.0_f32.powi(i as i32); + s += f * interpolate_bilinear(level, x, y); + max_possible += f; + } + + s / max_possible + } + + pub fn from_freqs(rand: &mut ThreadRng, width: usize, height: usize, n_levels: i32) -> Noise { + Noise { + levels: (0..n_levels) + .map(|i| { + let m = 2_usize.pow(i as u32); + Grid::from_fn(m * width, m * height, |_x, _y| rand.random_range(0.0..1.0)) + }) + .collect(), + } + } +} + +fn interpolate_bilinear(level: &Grid, uni_x: f32, uni_y: f32) -> f32 { + let x = uni_x * ((level.width - 1) as f32); + let y = uni_y * ((level.height - 1) as f32); + + let ox1 = x as usize; + let oy1 = y as usize; + + let ox2 = if ox1 == level.width - 1 { ox1 } else { ox1 + 1 }; + let oy2 = if oy1 == level.height - 1 { + oy1 + } else { + oy1 + 1 + }; + + let top = linear( + level.get_at(ox1, oy1), + level.get_at(ox2, oy1), + x - (ox1 as f32), + ); + let bottom = linear( + level.get_at(ox1, oy2), + level.get_at(ox2, oy2), + x - (ox1 as f32), + ); + + linear(top, bottom, y - (oy1 as f32)) +} + +fn linear(a: f32, b: f32, f: f32) -> f32 { + a + f * (b - a) +} + +struct Grid { + width: usize, + height: usize, + elements: Vec, +} + +impl Grid { + fn from_fn(width: usize, height: usize, mut f: impl FnMut(usize, usize) -> T) -> Self { + let mut elements = Vec::new(); + for y in 0..height { + for x in 0..width { + elements.push(f(x, y)); + } + } + Self { + width, + height, + elements, + } + } + + fn get_at(&self, x: usize, y: usize) -> T { + self.elements[y * self.height + x] + } +} diff --git a/src/terrain.rs b/src/terrain.rs new file mode 100644 index 0000000..49ccd50 --- /dev/null +++ b/src/terrain.rs @@ -0,0 +1,55 @@ +use crossterm::style::Stylize; + +pub enum Terrain { + DeepWater, + ShallowWater, + Beach, + Plains(bool), + Mountain(bool), + MountainTop, +} + +impl Terrain { + pub fn printable(&self) -> String { + match self { + Terrain::DeepWater => ".".blue().on_dark_blue().to_string(), + Terrain::ShallowWater => " ".on_blue().to_string(), + Terrain::Beach => ".".grey().on_yellow().to_string(), + Terrain::Plains(has_trees) => { + if *has_trees { + "Q".dark_green().on_green().to_string() + } else { + ",".on_green().to_string() + } + } + Terrain::Mountain(has_trees) => { + if *has_trees { + "Q".dark_green().on_grey().to_string() + } else { + " ".on_grey().to_string() + } + } + Terrain::MountainTop => " ".on_white().to_string(), + } + } +} + +pub fn terrain(height: f32, tree_cover: f32) -> Terrain { + let has_trees = tree_cover > 0.6; + + if height < 0.3 { + Terrain::DeepWater + } else if height < 0.35 { + Terrain::ShallowWater + } else if height < 0.4 { + Terrain::Beach + } else if height < 0.6 { + Terrain::Plains(has_trees) + } else if height < 0.65 { + Terrain::Mountain(has_trees) + } else if height < 0.8 { + Terrain::Mountain(false) + } else { + Terrain::MountainTop + } +}