I found myself needing to create a basic system that takes a word or phrase as a seed and returns some "random numbers" that were repeatable if the same seed were entered.
Obviously they aren't actually random but I needed something that would spit out completely different numbers for "aaaa" compared to "aaab" for example.
Think of it like a very dumbed down version of how Minecraft generates worlds based on the seed you enter.
To test it out I decided to build a "design your own burger" system based on your name or a phrase!
As far as I can tell it works and it can actually be quite good fun trying different names and seeing if the resulting burger matches that persons personality!
Instructions
Super simple!
Step 1
Enter your name or a phrase in the first input (minimum 4 characters).
Your unique burger combination will show below once you have entered enough characters! Keep trying words, phrases, your name etc. until you find a beautiful burger. (it is case sensitive so try capitalised and not capitalised).
Step 2
Once you have found a burger combination you like (or hate and think would be funny) press the "Copy Markdown to clipboard" button below the ingredients list (or select and copy all the text in the <textarea>
below the button).
Step 3
Paste the Markdown into a comment under the article.
Be sure to change the rating (if your burger creation isn't a 10 that is ๐) and if you want you can give your burger a silly description!
Oh and if you find a truly disgusting burger combination be sure to share that also!
Try it out!
Don't forget to share your creations / your username burger in the comments!
My favourites
Here are 3 burgers I created:
The InHuOfficial Burger
I couldn't possibly not share our very own burger namesake!
Apart from the blue cheese (not a fan) it seems like a beauty, double turkey bacon and bacon plus halloumi...delicious!
Username or phrase: InHuOfficial
Item | Ingredients |
---|---|
Bun | sesame seed |
Patties | elk burger patty, beef burger patty |
Sauces | chow chow, hot sauce, guacamole |
Toppings | turkey bacon, bacon, turkey bacon |
Cheeses | grilled halloumi, American cheese, blue cheese (stilton) |
Salads | coleslaw |
My rating out of 10: 9
My super serious description ๐: Eating this burger will improve your accessibility skills 200%!
The Independence Day burger
Had to fiddle a little bit to get a burger fit for America!
Three patties, American Cheese and a double helping of sweet potato fries seems like a good fit!
Username or phrase: 04th July
Item | Ingredients |
---|---|
Bun | crusty |
Patties | chicken breast burger patty, beef burger patty, bean burger patty |
Sauces | ranch dressing, chimichurri, sweet chilli |
Toppings | sweet potato fries, serrano ham, sweet potato fries |
Cheeses | american cheese |
Salads | lettuce, gherkin / pickles |
My rating out of 10: 8
My super serious description ๐: Nearly all American, if anything it perfectly reflects America in 2021 - American at the core with a nice sprinkling of flavours from other Countries and cultures to keep it interesting. A must try this July 4th!
The Ben Burger
How could we not include dev.to founder Ben?
The hilarious thing is it is an Elk burger (that is a Canadian thing right? Sorry I am an ignorant Brit)...and it has Maple Syrup on it....I couldn't stop laughing at the sterotype ๐๐คฃ๐คฃ!
In all seriousness though I think this sounds like it could be delicious! Joe Rogan would obviously approve given his obsession with Elk!
Username or phrase: Ben Halpern
Item | Ingredients |
---|---|
Bun | sesame seed |
Patties | elk burger patty |
Sauces | maple syrup, bbq |
Toppings | serrano ham, onion rings, pulled pork |
Cheeses | american cheese, goats cheese |
Salads | coleslaw, roasted red peppers |
My rating out of 10: 10
My super serious description ๐: This burger proves Ben is Canadian. I don't think I could have made it better if I tried! ๐คฃ๐คฃ
A few little bits
No tutorial for this one, just some interesting bits of info.
There are over 29 BILLION different burgers that this generator can create.
If you ate one variation a day it would take you 79.6 million years to try them all.
It is probably flawed due to the way I built it so maybe there will be duplicates. It is just a silly project after all and my brain hurts already. If someone sees a flaw please point it out.
If you want to dig into my shoddy code here is a link to the fiddle: https://jsfiddle.net/aoc2L06p/
The key is
var seededRandom = function(seed, max, min) {
max = max || 1000000000;
min = min || 137;
seed = (seed * 9301 + 49297) % 233280;
var rnd = seed / 233280;
return Math.round(min + rnd * (max - min), 0);
}
Apparently the numbers used on lines 5 and 6 are carefully calculated to produce a very even appearance of random numbers.
Unfortunately I couldn't track down the article that explained it.
Conclusion
From my testing it appears to work fine. The actual seededRandom
function does what I need it to do and that was where this all started.
So what is YOUR Burger? Does your name create a better burger than "Ben Halpern", "InHuOfficial" or "04th July"? Give it a try!
Top comments (24)
My Burger
Username or phrase: Quentin
My rating out of 10: 8.75
My super serious description ๐: cats and dogs wonโt be able to resist you after eating this burger
I imagine that is going to burn both on the way in as well as on the way out! Sriracha and double jalapenos!
Indeed, good thing I like spicy
So I put my name as monkey and:
Your burger ingredients
Bun: ciabatta
Patties: chicken breast burger patty, elk burger patty, turkey burger patty
Sauces: Gochujang
Toppings: ready salted crisps (potato chips)
Cheeses: monterey jack
Salads: avocado, kimchi, lettuce, kimchi
Double kimchi!
Also liking the idea of crisps, Monterey jack and Gochujang!
Monkey burger might just be on the menu!
My Burger
Username or phrase: Daniil
My rating out of 10: 10
My super serious description ๐:
I think that would be the perfect burger if it didn't have grilled aubergine!
i think I will consider it a bug and fix :-)
Wow. Like, WOW because Iโm vegetarian, and the first burger that was created from my name actually has no meat. Itโs magic ๐
The double ketchup is funny.
What do we want?
Ketchup!
Andโฆ?
More ketchup!
My Burger
Username or phrase: Danni
My rating out of 10: 10
I am speechless as I haven't found a truly vegetarian one yet! Double of any sauce is always welcome! ๐
Between that and Bens Canadian burger I do wonder if there is some witchcraft going on! ๐คฃ๐คฃ
Witch approved! (Since I'm wiccan. Guess, I can approve stuff. Bless it I can) ๐๐ฝ
I was actually so fascinated by your burger creator that I wrote a similar one. It picks books for you. I work at an online library, and, currently, my collegues amuse themselves with the book-picker. One of them wrote "Who am I?" instead of a name, and got a book titled "Bitch" ๐. Another got a book on how to teach your kids during lockdown. He has three ๐ถ๐ฝ
Cool book chooser, I got Kate Charles - False Tongues, looks interesting!
I am glad you took something silly and made it useful! ๐๐คฃ
My Burger
Username or phrase: Usenmfon
My rating out of 10: 10
My super serious description ๐:
Well as I am British I have to approve any burger that uses an English Muffin! ๐คฃ
That burger looks like it would make an awesome breakfast burger!
My Burger
Username or phrase: mohd_ahmad
My rating out of 10: 10
My super serious description ๐:
You managed to find a rare vegetarian one! I wonder if anyone can find a vegan one?
The sauces are the only thing that don't quite work on this, pesto, sour cream and teriyaki? I mean, never say never but I can't see that working ๐๐คฃ
My Burger
Username or phrase: siddharth
My rating out of 10: 7
My super serious description ๐: Looks like something my brother would absolutely love!
I would defo be up for trying that, not sure about pesto and chilli con carne but I will try anything once ๐
The Empty Burger
Username or phrase: โโโโ
Certainly wouldnโt leave you feeling empty! Quite surprised it wasnโt a burger based on CSS!
I rate it a 10 though as wagyu beef and portobello mushrooms...delicious!
I don't care about your "minimum 4 characters"!
My Burger
Username or phrase: cssโโ
My rating out of 10: 5
My super serious description ๐: I hate bacon
Look at you with โhealthyโ burger...a rare 6 salad burger! ๐๐คฃ
But โhate baconโ...how is that possible?
@ben I hope the burger my contraption designed is to your liking...I apologise that my code enforces stereotypes ๐๐คฃ
I look forward to seeing some delicious (and not so delicious) burgers from you all!
Bonus points if your burger description or name is super silly ๐