How I Practice Programming: Five Dice

preview_player
Показать описание
In this unusual video, I describe how programming practice needn't be stale and boring if you take inspiration from everyday things you find interesting, and viewed through the eyes of a programmer. Specifically I look at the implementation of 5 Dice based games, like Yahtzee.

Рекомендации по теме
Комментарии
Автор

I REALLY appreciate these sorts of coding videos where someone explains the logic and thought process behind the code they write. I feel like this kind of thing is very sorely lacking in a lot of programming tutorials. It's not so important that you know WHAT code to write as much as WHY you would write it in the first place.

zachreitan
Автор

"I don't like regular expressions because fundamentally I don't understand them"
that hit close to home

kadensharpin
Автор

At college we used to say “Practice Only on the days you wake up”
If you’re in a comma, bedridden or dead, you are excused.

StuartLoria
Автор

i really hope you don't stop making videos because I really love your calming pace and voice and I love using your olc engine

salockingaming
Автор

Yatzy was the third program I wrote in high school in 1981. Programming language was Comal, a Basic derivative. The program worked but lacked structure. Learned the need for subroutines the hard way :) Did I forget to mention it was written on punch cards for a RC-7000 computer? It had 326 lines with no blank lines, why waste a card? On par with this C++ program, but mine had the computer play against you!

JanKjeldsen
Автор

To detect the full house, you can encode it in "nnnmm" and "nnmmm", handling the m value exactly as the n value (but in a separate variable).

Nioub
Автор

@javidx Great video! (as always)
One thing I noted:
Maybe I do not know rules of game, but for me small straight pattern looks wrong - for instance 12234 don't match. Also five of a kind can be treated as full house, which shouldn't be possible.
I think it is a good idea to set few dices sets manually for testing and then use random.

ziolkovy
Автор

One of my proudest programming accomplishments was writing a full-featured single-player yahtzee game in BASIC on the Vtech PreComputer 1000.

wolverine
Автор

How I do it:
1. Search for some absurd idea on the internet or think of something actually useful :)
2. Just do it
3. Get frustrated, but also just do it
4. Finish the project in an acceptable state

Backtrack
Автор

You could be the reason that fostered me to learn c++ i did not start c++ yet but i am thinking it currently . Love your videos !

EzioOmer
Автор

I have learned so many things through your videos. You are the kind of person I always wanted to be. Please continue to make more this kind of useful videos. I will be very, very grateful to you and hope you and your family will always be healthy!!!!

nsrcmpb
Автор

Your videos are amazing, very thorough and informative. I am only at the beginning stages of learning to program and understand very little but I still love how you explain the logic behind programming which most do not. You are one of the only few who inspire me to keep going. Keep up the great work!

delgadogorn
Автор

What a lovely video. Simple, yet some parts have depth in it.

piratux
Автор

An excellent video! I love breaking down a tricky problem and getting the program just running bug free (I call it the first hurdle). Then look to refine and refine the algorithm to make it more and more efficient - also more concise. Something you did particularly well here. Great stuff.

stephenelliott
Автор

Well I saw the discord status "Uploading a video" and came here. I love your videos so much as a kid who obsessed with computers and stuff you are my hero when it comes to programming

drn
Автор

You're a genius! I've got to learn how to optimise my code like that. It does happen sometimes that I write a neat little piece of code which does a lot, and I do get praised for it at work, but often times I rush to another tasks at hand without really thinking about what I wrote and of ways of making it better. Often times do I go back to my code only to realise how terrible it is at a first glance. Such inquisitive and robust optimisation will definitely take some time to learn, but the end result seems to be more than worth it! I'm glad I decided to watch this video.

Loleexer
Автор

Great idea to shoot a video about this, even the best need it sometimes

utkugokalp
Автор

At 33:35 you have a small straight but the pattern match doesn't find it because there are two fours keeping the straight from being consecutive.

bryceschultz
Автор

You make awesome videos! I found your channel now and this is the best thing ever! You videos make me wonder if anyone need graphic engines like OpenGL or SFML.

ayo_trivedi
Автор

I'm learning a lot from this video !! THANK YOU !

mailenolivera