Тёмный
No video :(

The Secret Purpose of Programming 

Kedrigern
Подписаться 996
Просмотров 2,2 тыс.
50% 1

In this video, I reveal an astounding secret of programming. You will also get to see some cons of sharing your code online. This part is hilarious.
Then we will dive into the world of binary numbers as I try to code a binary counter. Has it already been done? Well, this will be a pursuit of optimization. We aim to write as short as possible code that runs faster than it can fail.
This is a race against time as we attempt to write bug-free code while not losing our sanity.
This combination of hilarity, mess-ups, and coding challenges is sure to intrigue and entertain anyone interested in the workings of a software engineer's mind.
🔔 Subscribe to the channel for more gaming adventures, coding challenges, and tech insights!
🎬 Watch the full 7 Billion Humans series here: • 7 Billion Humans
🎮 Other Puzzle Videos: • Shapez Puzzles
🔥 Shorts: • Shorts
0:06 Finding a Glory hole
1:44 The Hardest Level Ever
2:58 I wrote the best code
4:21 Rudest Comment I ever got
5:18 Actual Coding
11:42 Getting advice
12:09 Further Optimization
#puzzlegame #codingchallenge

Опубликовано:

 

23 авг 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 13   
@Liwet.
@Liwet. Месяц назад
You could do it faster if you made each block holder run their own line of code. Having them rely on each other rather than just themselves adds additional waiting steps. Your solution will bloat but should also be faster. You can use the button presser's positioning in relation to each block holder to separate them then have them manually track the counter themselves and put the block down and up as needed.
@KedrigernGaming
@KedrigernGaming Месяц назад
I honestly really wanted to...but got terrified of the initial complexity. Also I was like..."nah, it's probably gonna take them ages to figure out which person they are". But man you are right. I should find the courage and implement this!
@temtempo13
@temtempo13 Месяц назад
@@KedrigernGaming It's pretty slow, but not too bad. You only have to worry about the middle two workers, as the leftmost and rightmost workers can figure out who they are with a single check (step down once, and then if I don't have a sensor to my lower-left, I'm the leftmost worker). Middle two workers can figure it out pretty easily from there if you have the leftmost/rightmost workers step out of the line.
@FoxSlyme
@FoxSlyme Месяц назад
Did you already forgot how to "wait until" with just a single jump? I'm referring to the code at the end that uses 2 jumps per "if" block. "If the condition is not met, check the condition again"
@KedrigernGaming
@KedrigernGaming Месяц назад
Yeah that happens when I focus on something else. So I simply don't realize I could write it differently.
@Marcsine
@Marcsine Месяц назад
A lot of time is spent on walking up and down. It would probably be much easier to write a fast solution if the counter people stayed on the pads and look at the adjacent space for a datacube appearing and disappearing before either picking up or dropping their cube.
@KedrigernGaming
@KedrigernGaming Месяц назад
I wanted to! Sadly the people see a datacube no matter if it's on the ground or being held by another worker :/
@temtempo13
@temtempo13 Месяц назад
How bizarre, I came back to this puzzle today and solved it, only for RU-vid to immediately recommend this video. That's cool to see another solution: your size challenge solution is similar to what I was going to try next, now that I've done Decimal Counter as well, except you were clever enough to have the left-most worker send a signal directly to the button-pusher, instead of propagating the signal back to the right. I learned something! My initial solution was just to have each of the "digits" stand in place and manually do the math in their heads, not communicating with each other at all. Each worker started by calculating the value of their slot. Then, for each number, they would subtract the value of higher slots if relevant, before determining whether the resulting number still needed their slot or not. So for example, the person second from the left has a slot value of 4. If the number is 9, they first subtract 8 from it to get 1. 1 is smaller than 4, so their tile isn't needed for the solution. If the number was 13 instead, they would subtract 8 from it to get 5, and since 5 is still larger than 4, they would put their tile down to add it to the solution. Thanks for the video!
@KedrigernGaming
@KedrigernGaming Месяц назад
They are tracking us! So glad I have actually done something right. Thank you for the praise! You solution is genious! I believe this is very similar to what you have to do in the following levels.
@temtempo13
@temtempo13 Месяц назад
@@KedrigernGaming Clever, perhaps, but slow! Every number ends up taking roughly the same amount of time to process, even if you only need to toggle the first bit from 0 to 1. Very tedious for the 1-bit worker, who has to manually process every other bit before they're able to determine if their number is odd or even! ...although now that I say that, I suppose I could've just had them divide the original value by 2, then using the result of the integer division to determine if the number is odd or even... ...I started with a solution like that, but hit a dead end... I also ran into a problem trying to use a similar solution for the Decimal Counter: my workers can only memorize values up to 99! I ended up having to do something like you did, propagating a signal left as needed. And ended up exactly one instruction over the size challenge... I'm really impressed by how many challenges you've completed!! I feel like I can usually get the speed challenge if I set my mind to it, but the size challenge tends to elude me... congrats on your solutions!
@KedrigernGaming
@KedrigernGaming Месяц назад
I have hit a dead end so many times as well. Also does not help that my brain somehow turns off whenever I press "record". If I remember right, my decimal doubler "propagates" a signal but enables all the workers to calculate at the same time. That was a really fun level. Thank you! I honestly appreciate the compliment!! I on the other hand feel like the size challenges are a bit easier. And the speed ones I tend to miss by like 10 seconds and require a completely different approach (solution).
@thiagof414
@thiagof414 Месяц назад
I don't know what is going on but I like your style.
@KedrigernGaming
@KedrigernGaming Месяц назад
Thank you!
Далее
This Coding Challenge Made Me RAGE
27:22
Просмотров 2,4 тыс.
Advanced excel-Short Courses Training
1:40:27
Harder Drive: Hard drives we didn't want or need
36:47
Dear Game Developers, Stop Messing This Up!
22:19
Просмотров 705 тыс.
I integrated Aseprite with my game engine | devlog
3:12
71 Updates You Need to Know as of Minecraft 1.21
34:23
Mojang sneaks in the best EATING UPDATE ever.
5:53
Просмотров 378 тыс.
10 weird algorithms
9:06
Просмотров 1,2 млн