everybody must play life is strange, doesn’t matter if you don’t know the spelling of gaming or you’re a senior AAA game developer

Advertisements

1000 digits

sup. i want to make it quick. i stumbled upon a problem and 20 seconds in and i was able to come up with a solution. this post might be technical but you can try to fit in.


The Fibonacci sequence is defined by the recurrence relation:

Fn = Fn−1 + Fn−2, where F1 = 1 and F2 = 1.

Hence the first 12 terms will be:

F1 = 1
F2 = 1
F3 = 2
F4 = 3
F5 = 5
F6 = 8
F7 = 13
F8 = 21
F9 = 34
F10 = 55
F11 = 89
F12 = 144

The 12th term, F12, is the first term to contain three digits.

What is the index of the first term in the Fibonacci sequence to contain 1000 digits?


there are several hard or proper ways to do it but i just added a single line of code with a condition.

Screen Shot 2017-07-17 at 8.12.29 PM

quick breakdown, wrote a simple program for creating a fibonacci series, made a condition which i feel is really clever.

now watch.

i converted the integer to a string and then checked the length of the string and conditioned that if it equals to 1000, then we stop. meanwhile the counter is incremented by 1 until the loop breaks. so the answer was 4782. this is a hack-ish sort of way.

so when someone asks what is the index of the first term in the Fibonacci sequence to contain 1000 digits? remember to say 4782

bye

Debian

I installed Debian and started using it while barely familiar with bash, but I’m learning. Out of the several desktop environments, Cinnamon is my favorite, after all you are free to choose what ever the dash you want.

One part is, Debian runs on an impressive number of hardware architecture i.e: alpha, amd64, armel, hppa, i386, ia64, mips, mipsel, powerpc, s390, and sparc (I myself don’t know half of these) The stable versions are extensively tested and only receive updates that are critical to security. That’s a stable and secure operating system.

Actually, I broke my Windows while installing Debian on my USB. Power of the PC is only a valid say when there is Windows, so there’s no gaming until I fix it back. But for the rest of the part, I think I’m going to stay with Debian.

Isometric Render : The Park

Here’s a second isometric tile. This time with a park. If you look closely you’ll notice that I added some shoes, ketchup bottles and a tennis kit just for some detail hehe. Oh and that kiosk is a hotdog stall by the way.

In first place, I wanted all the objects in a toy like plastic material but after hours of trying different node setups, I gave up and rendered the image.

tennis
Experiments with Isometrics : The Park

Man oh man I found a way to achieve it after rendering it. I didn’t want to go back and re-shade every object by assigning a new material to them. So I’ll use the new setup in future renders.

Here’s a visual example of how adding one sensible godly node changed the entire scene.

This is what I got after adding a kajillion nodes, mixed them together with each other and hoping to get it right.

19ibsks-squashed

It looks washed out, unrealistic and completely not toy like. It turned out like exactly how I not wanted it to be.

But after adding a Fresnel node into the mix shader, this is what I got. Look at that beautiful clay like toy plastic. Magical.

2n8p63y-squashed

This difference helps us to identify the geometry as shadows and highlights are an important part of how we perceive an absolute object.

tip_1
How shadow affects geometry

So, that was an interesting thing to learn in this long journey and I believe that I’ll learn more as we go along.

Isometric Render : The Store 

Hey. The Store is quite a good name for a store 😛

I’ve been experimenting with a few settings and trying to learn how tilt shift effect in 3d modeling works. Looks like I have to understand how actual real life cameras and tilt shift lenses work.
Tilt shift is a kind of illusion that makes real life seem like a miniature play set.

 

It’s quite beautiful and colourful!

 

So in the meantime I had a little progress with a render. This is “the store” that we were talking about. Might lack some details but I’ll try to step up with each new post.

Feedbacks welcome 🙂

Snake and Ladder

Snake and Ladder is a simple game of race contest based on sheer luck, and is popular with young children. I’ve played the game and was the only game that was available before AAA Multiplayer titles and Steam existed. More information

I then came up with a challenge to myself to create the entire framework of snake and ladder within java.

We’ll start with a simple good old’ flowchart for the procedure of the game.

snake-and-ladder

So we’ll have two variables here. We’ll name the variables p1 and position.

One for a random number that you get between 1 to 6 every time you roll the dice and another for calculating the position of the player respectively.

After that we’ll have to create a random number between 1 to 6 because a dice has 6 sides. We’ll create a function for that and we’ll name it add_roll();1note that we’re not only creating a random number between 0 to 6, but we’re also adding it to the position so each time you generate a random number, it is added to the position just like the board game.

According to our flowchart once we roll a dice, we have to check if the position of the player is lesser than 100 and perform functions accordingly.

So we’ll create a function called check_game();2So if the position is over 100, the system will terminate process and display “Game Won!” the game is still not over yet, if the position is less than 100, then we have a few more function to process. So we’ll move on.

Following the flowchart; after checking the position, we have to check if there is a ladder present in the current position obtained by the user by rolling the dice.

So for that, we’ll create a function called ladder_climb(); I referenced to a real life board game and it has ladders at the following positions: 4(+10),9(+21),20(+18),28(+56),40(+19),51(+16),63(+18) and 71(+20).

We’ll check if the position is equal to any of the values above and we’ll increase the position value according to the ladder. 34

If we do not find a ladder, then we are simply moving on to the next step. Finding a snake.

Following the flowchart again, we are supposed to check for a snake after a ladder has been found. So we’ll create a new function called snake_down(); And again I referenced to the board game, and found snakes at the following positions: 17(-10), 54(-20),62(-43),64(-4),87(-63), 93(-20),95(-20),99(-21).

We’ll check if the value of the position is equal to any of the above found numbers and decrease the value of position accordingly.56if the snake is not found at all, then we’re simply going back to call the check_game(); function which in turn calls the add_roll(); which again checks for snakes and ladders. This continues until the player reaches 100.

So we’ve done the game, now it’s run time. So upon running the program, after a couple presses of the return key, this was my result.


The player is at 0 +0
You found a ladder! +10
The player is at 14 +4
The player is at 18 +4
The player is at 22 +4
The player is at 26 +4
You found a hugeeeeeeeeeeeee ladder! +56
The player is at 84 +2
The player is at 86 +2
The player is at 86 +0
The player is at 88 +2
The player is at 90 +2
The player is at 90 +0
The player is at 90 +0
The player is at 92 +2
Ouch you got bit by a snake! at 95 -20
The player is at 75 +3
The player is at 79 +4
The player is at 84 +5
The player is at 86 +2
The player is at 89 +3
The player is at 89 +0
The player is at 91 +2
The player is at 92 +1
Ouch you got bit by a snake! at 95 -20
The player is at 75 +3
The player is at 80 +5
The player is at 83 +3
The player is at 83 +0
Ouch you got bit by a snake! at 87 -63
The player is at 24 +4
The player is at 25 +1
The player is at 27 +2
The player is at 32 +5
The player is at 33 +1
The player is at 39 +6
The player is at 41 +2
The player is at 46 +5
The player is at 47 +1
The player is at 48 +1
The player is at 53 +5
The player is at 57 +4
The player is at 59 +2
You found a ladder! +18
The player is at 81 +4
Ouch you got bit by a snake! at 87 -63
The player is at 24 +6
The player is at 26 +2
The player is at 30 +4
The player is at 32 +2
The player is at 38 +6
The player is at 42 +4
The player is at 43 +1
The player is at 48 +5
Ouch you got bit by a snake! at 54 -20
The player is at 34 +6
The player is at 34 +0
The player is at 36 +2
The player is at 37 +1
The player is at 42 +5
The player is at 48 +6
The player is at 48 +0
The player is at 48 +0
Ouch you got bit by a snake! at 54 -20
The player is at 34 +6
The player is at 38 +4
The player is at 44 +6
The player is at 44 +0
The player is at 50 +6
The player is at 52 +2
The player is at 52 +0
The player is at 57 +5
Ouch you got bit by a snake! at 62 -43
The player is at 29 +5
The player is at 33 +4
The player is at 35 +2
The player is at 35 +0
The player is at 37 +2
The player is at 41 +4
The player is at 44 +3
The player is at 45 +1
The player is at 46 +1
You found a ladder! +16
The player is at 67 +5
You found a ladder! +20
The player is at 91 +4
Ouch you got bit by a snake! at 93 -20
The player is at 73 +2
The player is at 74 +1
The player is at 77 +3
The player is at 77 +0
The player is at 80 +3
The player is at 84 +4
The player is at 86 +2
The player is at 92 +6
The player is at 98 +6
The Player reached 102
Game Won!


Process finished with exit code 0

There we go, It works. Looks like I’ve won at my game.