My Newest Little Project

Sometimes it is worth stepping back from work related projects and focus on something that you find more fun. Over the last month or so, I started to work on a couple of these fun little projects.

The project I’m going to show here is a sand simulator. There is a short animated gif shown below.

This project came from watching a Youtube video where someone explained creating their own version of a sand simulation. I used many of their ideas, but implemented them in my own ways. What you see above is the current version of what I have been playing with. The app includes 8 different types of particles that interact with each other in different ways. Sand will pile up like sand does. Water attempts to level itself. Snow and ice pile up in their own ways and fire will turn water, ice or snow into steam that will rise off the screen.

There were many interesting techniques used to make this all happen with the main movement based on Cellular Automata theories. Each particles moves by looking at it’s surrounding neighbors and then decided how to move. For the most part, they only care about the 8 locations directly surrounding them. As simple as that sounds, it allows for some interesting and occasionally surprising interactions.

Doing this project let me work through some interesting programming issues, while at the same time giving me something fun to play with. A majority of the code fits in around 400 lines and it does everything you can see above.

So, if you find yourself stuck – step back and find a small project that appeals to you and work on that. It will not only better your programming skills, but it will also allow your brain to reset before you return to your actual work.

Huh… So Much For Once A Week

I thought I’d follow up a bit with what I’ve been up to over the last few weeks. I have been hard at work on my newest version of my Time Clock Helper app. It is almost ready for release, I’m working on some help screens right now, but other than that it all works. It does several things that the original app didn’t do, so that is handy. It also gives the user more control over what they will see on the screen and how they interact with it.

It has been slow going since I’ve been working on learning SwiftUI at the same time. I like it for the most part, but some parts of SwiftUI are a bit unclear, or unstable. I have learned a lot, though. It makes it nice going between different devices and letting Swift take care of making sure everything is laid out in a decent manner. It sure beats the hours I used to have to spend getting constraints just right for a storyboard. Changes can now take seconds to implement that used to take minutes or hours before.

So, yeah. SwiftUI has been worth the effort to learn and it promises to get easier and more powerful in the future.

Another Helpful Site To Learn About Swift.

www.hackingwithswift.com is a great site to get information on Swift. The pages cover a wide variety of topics in a concise manner that works well when you need just a bit of help. The pages have many examples of code, along with multiple books that can teach all levels of Swift programmers – from a beginning programmer, to an expert. There is always something new to learn and this page can supply it.