Skip to main content

My second try on the Titanic problem

Titanic 2 - New try

Comments

Popular posts from this blog

How many paths the snake in the Snake game can take?

How many paths the snake in the Snake game can take? I was given this challenge last week and I thought I would share my way of solving it with you all Y'all know the famous game "Snake", so no need for an introduction now. The question is easy: given the position of the snake within a map of known size and the number of movements the snake can do, how many distinct paths can the snake follow without intersecting itself and without going out of the map's boundaries? Maybe once you go over it the question is not as easy as it sounds, so let's illustrate it with an example. Let's imagine we have a map that contains 4 rows and 3 columns, like the one below. And let's imagine that we have a snake whose body occupies the following cells: [(2,2),(3,2),(3,1),(3,0),(2,0),(1,0),(0,0)]. The figure on the left represents the empty map and the one on the right represents the one with the snake, where the numbers are the positions of each "piece" of the snake

A first approach to IoT, connecting my 3D printer to the internet

My first approach to the IoT, connecting my 3D printer to the internet IoT is one of those fancy words that people like to talk about in conferences and in TedTalks without (apparently) having too much idea of what it is all about. Set up to manage the 3D printer through the internet This one is going to be a short entry where I don't go through code or anything, just wanted to talk about a bit about how I connected my 3D printer to the internet.  I've been in the 3D printing thing for a while now, about a year and I haven't stopped printing ever since I bought my Ender 3. Fortunately enough, I live in a big house where my room/working place is on the fourth floor and my 3D printing is on the first one. You might be thinking as well: "OK Pablo but where do you want to bring us? Go to the point" Well, as you might have noticed there are two floors in betw