From f4b819976344ca0c3e0379e6555f36a0ebcb505c Mon Sep 17 00:00:00 2001 From: Skye Im Date: Tue, 15 Nov 2022 17:51:56 +0100 Subject: skairunner: Make fibonacci generator --- entries/skairunner/README.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 entries/skairunner/README.md (limited to 'entries/skairunner/README.md') diff --git a/entries/skairunner/README.md b/entries/skairunner/README.md new file mode 100644 index 0000000..1d98b17 --- /dev/null +++ b/entries/skairunner/README.md @@ -0,0 +1,24 @@ +# What is it + +A Fibonacci generator that produces a valid Protobuf3 file. + +Each message is Fibonacci#, where # is the number in the sequence (i.e. f(#)). +The field "number" has a field number corresponding to the value of f(#) and a random type. + +The field `prevprev` has the type of the message corresponding to f(n-2) and has a field number of the value of f(n-2). +Similarly, the field "prev" has the type of the message for f(n-1) and the field number of f(n-1). + +Fibonacci1 does not have `prevprev`/`prev` because field numbers have to be greater than 0. +Fibonacci2 does not have `prevprev` for the same reason, while `prev` is omitted because duplicate field numbers are forbidden and f(1) = f(2). +Fibonacci3 does not have `prevprev` either. + +The last sequence number generated is 43, because after that the field numbers become too large and are illegal. + +## Running +With `cargo` installed on your system, `cargo run` will compile and output the protobuf file to stdout. + +To verify that the protobuf compiles, something like +``` +cargo run > fib.proto && protoc -odescriptors.proto fib.proto +``` +should work. Note that you will need `protoc` to do that. \ No newline at end of file -- cgit v1.2.3-70-g09d2