What inspired me to do it?

This is actually a Homework Hack with an algorithm that is a very famous yet little-known application of circular linked lists. A linked list is a structure whose cells are scattered throughout memory and are connected together like a chain.

What does it do?

After the user enters any total number of rebels that would form a circle during the Jewish-Roman War, the program will repeatedly rotate the circle counterclockwise and kill every second person until there is only one person still living.

How did I build it?

I created two .py files: LInked_List_VTHacks.py and Josephus_VTHacks.py. In the Linked List file, I created a public Linked_List class and a private __Node class that will create such nodes for the user when the program runs. The methods to be tested as I work further on that file are append_element(), insert_element_at(), remove_element_at(), get_element_at(), and rotate_left(). In the Josephus file, I called the rotate_left() and remove_element_at() methods from the Linked_List class in order to follow the rules of the Josephus algorithm. The total number of rebels in the circle varies per runtime.

What challenges did I run into?

The biggest challenge I have faced upon completion of my Python files is finding an effective software or web program that would either translate my files for JavaScript or accept my files for app developing purposes. As the hackathon starts, I was hoping to create a simple iOS calculator app that would teach consumers how the Josephus problem works. However, I only have access to a Windows computer, and I have struggled for hours to determine which sources are best for creating the mobile app.

What are my proud accomplishments for this hackathon?

Stepping into my very first hackathon at a campus four hours away from my home institution is by far a much bigger accomplishment for myself than just working hard to earn prizes. I always seem to struggle to determine whether or not I write the code properly. Thankfully, I made new friends at my school's Association of Computing Machinery, and they gave me fresh perspectives toward reaching my solutions quickly. Since I am getting the most out of computer science in general, I look forward to boosting my technical knowledge in preparation for future hackathons.

What did I learn from this hackathon?

I have learned that no program requires perfection, especially when it has to be completed in one or two days. In addition, doing research on many other languages for possible conversion from Python would have been beneficial if it was conducted before the hackathon started. Being flexible during the planning stage is something I would have kept in mind. It is quicker to create apps with drag-and-drop features, but it is not for implementing code with the right language for the iOS app to run on.

What are my next steps?

As soon as I either clean out my Windows computer or purchase a brand new one, I would do my best to create the Josephus Calculator mobile app in my spare time. I could also use this project as a guide for establishing algorithms for mathematical models in the field of neuroscience.

Built With

  • python-idle
Share this project:

Updates