Posts

Showing posts with the label proyects

Going to Learn Java

Image
Did you know more than 3 billion  devices run Java? This coming semester I'm gonna be taking a Java course (better late than never!) . Gonna use this time to learn as much as I can . I will try hard to make any new proyects in Java. I'll be sure to update frequently.

Efficient Fibonacci (WIP)

Image
This was a little side thing I've been working on. I wanted to find a way to find a number (especially big ones) in the Fibonacci sequence without using recursion or memoization. After researching it a bit I came across this equation online. F(n) = ⌊Φⁿ/√5 + 1/2⌋,  with   Φ = (1+ √5 )/2 With this my program could find the right number from any position n  without resorting to make multiple recursion and having to find the Fibonacci of every number below n , effectively ( hopefully ) making it faster and more efficient.

"Random" Hot Potato with Queues

Image
Now this is an old proyect I made for my Data Structures class in college like around a year ago -ish . The goal is to simulate a random game of Hot Potato utilizing queues (in my opinion this would've been better with a circular link list, but whatever). This was coded in C++. While simple, there was a bit of a problem I had noticed where using random() didn't really produce a random outcome. In fact everytime it was excecuted it generated basically the same results. This is because the random function is actually pseudo-random. To overcome this hurdle, I found that using the timer()  function from the ctime  library (this will give you the actual time),  in conjuction with random()  reduced the likelyness of repeat  patterns (I say this so I don't claim it's completely random) I might have gone overboard with creating a seperate time and subtracting it with the current time, which in hindsite wasn't necessary. (The important thing is that I know t...