diff options
| author | gingerBill <gingerBill@users.noreply.github.com> | 2024-04-15 12:12:20 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-04-15 12:12:20 +0100 |
| commit | 758ace844c6c39acb32adaead87c56caf337de82 (patch) | |
| tree | b313c3ebfcd1f976072393a73734da88159aabd3 /core/container/bit_array | |
| parent | b9d7b8d616bc784ef1e6b8e10805938de1546108 (diff) | |
| parent | a0cff82320840e4be6d40cee8a2432645773a53e (diff) | |
Merge pull request #3428 from mgavioli/fix_core_docs
Fix the format of some `doc.odin` files of the `core` library…
Diffstat (limited to 'core/container/bit_array')
| -rw-r--r-- | core/container/bit_array/doc.odin | 75 |
1 files changed, 37 insertions, 38 deletions
diff --git a/core/container/bit_array/doc.odin b/core/container/bit_array/doc.odin index 52e252d8a..371f63f0e 100644 --- a/core/container/bit_array/doc.odin +++ b/core/container/bit_array/doc.odin @@ -1,53 +1,52 @@ -package dynamic_bit_array - /* - The Bit Array can be used in several ways: +The Bit Array can be used in several ways: - -- By default you don't need to instantiate a Bit Array: +- By default you don't need to instantiate a Bit Array: - package test + package test - import "core:fmt" - import "core:container/bit_array" + import "core:fmt" + import "core:container/bit_array" - main :: proc() { - using bit_array + main :: proc() { + using bit_array - bits: Bit_Array + bits: Bit_Array - // returns `true` - fmt.println(set(&bits, 42)) + // returns `true` + fmt.println(set(&bits, 42)) - // returns `false`, `false`, because this Bit Array wasn't created to allow negative indices. - was_set, was_retrieved := get(&bits, -1) - fmt.println(was_set, was_retrieved) - destroy(&bits) - } + // returns `false`, `false`, because this Bit Array wasn't created to allow negative indices. + was_set, was_retrieved := get(&bits, -1) + fmt.println(was_set, was_retrieved) + destroy(&bits) + } - -- A Bit Array can optionally allow for negative indices, if the mininum value was given during creation: +- A Bit Array can optionally allow for negative indices, if the minimum value was given during creation: - package test + package test - import "core:fmt" - import "core:container/bit_array" + import "core:fmt" + import "core:container/bit_array" - main :: proc() { - Foo :: enum int { - Negative_Test = -42, - Bar = 420, - Leaves = 69105, - } + main :: proc() { + Foo :: enum int { + Negative_Test = -42, + Bar = 420, + Leaves = 69105, + } - using bit_array + using bit_array - bits := create(int(max(Foo)), int(min(Foo))) - defer destroy(bits) + bits := create(int(max(Foo)), int(min(Foo))) + defer destroy(bits) - fmt.printf("Set(Bar): %v\n", set(bits, Foo.Bar)) - fmt.printf("Get(Bar): %v, %v\n", get(bits, Foo.Bar)) - fmt.printf("Set(Negative_Test): %v\n", set(bits, Foo.Negative_Test)) - fmt.printf("Get(Leaves): %v, %v\n", get(bits, Foo.Leaves)) - fmt.printf("Get(Negative_Test): %v, %v\n", get(bits, Foo.Negative_Test)) - fmt.printf("Freed.\n") - } -*/
\ No newline at end of file + fmt.printf("Set(Bar): %v\n", set(bits, Foo.Bar)) + fmt.printf("Get(Bar): %v, %v\n", get(bits, Foo.Bar)) + fmt.printf("Set(Negative_Test): %v\n", set(bits, Foo.Negative_Test)) + fmt.printf("Get(Leaves): %v, %v\n", get(bits, Foo.Leaves)) + fmt.printf("Get(Negative_Test): %v, %v\n", get(bits, Foo.Negative_Test)) + fmt.printf("Freed.\n") + } +*/ +package dynamic_bit_array |