Amateur Programmer Thread

Professional Programmers ARE NOT ALLOWED TO POST HERE.

Bonus Points are awarded to those that utilize ■■■ (non-{C++, Java, JavaScript. C#} languages) and underutilized programming paradigms (functional, stack-based, array).

1 Like

Pull up in my lamborjni

Made no commits today.

1 Like

I wrote this today: it's a bloom filter that utilizes const generics to reside entirely on the stack. You can see how 'k' is simplified to a value at compile-time and the loop is unrolled. :-)

#[derive(Debug)]
pub struct MinBFStack<const M: usize, const N: usize> {
    m: [u8; M],
}

M, the size in bytes, N: the number of items in the set.

There's a few unstable flags to introduce more complicated expressions: I was most interested in floats, Option<T>. With these probabilistic data structures, it would be cool to have something like

struct T<BUF_SIZE, FALSE_POSITIVE_RATE, SET_SIZE> // (potentially wrapped in Options) and then have the parameters of structure rendered to constants at compile-time.

The assembly code on this page is easier to read the the Rust.

What can I say? I'm just an Amateur Programmer.

This is now an amateur osu mappers thread

@Vanilla_Town get in osu

let's trade some maps bro

Get in V Rising

At some point I wanted to include Hasher as generic parameter, and then use the trait default to something akin to: H: Hasher=DefaultHasher (or whatever the syntax is) but the compiler was throwing errors at me. Might try it tomorrow.

based and errorpilled

I refuse to learn C++ as it would render me a Professional Programmer but I imagine this achieved through template voodoo.

1 Like

In regards to offloading computation to the type system: I very much have desire to read The Little Typer.

I have some massive tome to finish for the book club I joined so I doubt I will be able to make much progress.

New code, What do you think?
image

@CulturedUrbanite How many commits a day should an "Amateur Programmer" be making? I don't want to make too many, else I would become a professional.

Not really sure why your method is named dodgeChance. That seems like it would be the name of a variable

What the hell is a Method?

Function

Dont fight with me i can traverse binary trees