Shipped this project!
Although I didn’t win the competition, I still had fun building this.
I finished building this a while ago, but just took a while to put onto Testflight
So I came up with the idea of this because I wanted to make a stock market like simulator, but something different.
So the idea is going to be you’re at a theme park, and the queue times change every 5 minutes, and you need to get on as many rides as possible before the theme park closes.
First, I setup the project, and created the classes for Ride and Player.
After that, I created a method within Player called game which lets me see the time, then move to the next 5 minute interval, until the day has ended!
Log in to leave a comment
This is my first C++ project, and I built this because I wanted to understand how OOP works and how to write efficient OOP code.
I had lots of fun with this as I got to learn about classes, header files, and more OOP concepts while building a fun game that I got many of my friends to play.
I wanted it to be more than just a regular Blackjack game, so at the end of each game, I analyse the playing styles of the user and generate a blackjack personality type.
Thanks for reading, and I’d love any C++ critique.
This is the last devlog and I spent most of this time working on generating an executable for Mac and Windows even though I don’t have a Windows.
After creating one, and testing on both, I realised that I can’t see the card emojis in the Windows executable, although I can in the Mac one, so I managed to make UTF 8 work on Windows and Mac.
After that, I created the README and fixed some final things before creating the release on GitHub!
Log in to leave a comment
I wanted the code to be as good as possible, so I:
Deck and Card classes to deck.h and deck.cpp, and added Hand, Player and Game to game.h and game.cpp
Now the code looks much nicer. Thanks to the 2 people who reviewed my code.
Anyone have any more feedback, let me know, and I’ll implement it!
Log in to leave a comment
To make this more interesting and different from other blackjack games, after you finish playing (either hit 0, or decided to stop with the money you have), your whole game is analysed and is assigned a personality type (there are 8).
The highest one is WINNER so people might want to keep trying until they get this.
Log in to leave a comment
add_card to Player, and made Player.hand private, which meant that the code is better encapsulated.std::shuffle
Log in to leave a comment
This time I decided to work on the player betting money.
For this, I created a Player class which handled storing the user’s money, then the user gaining and losing it through the gain_money and lose_money methods.
I then worked on the main() function which handles the main game and added a loop which continues running the game until the user stops betting money.
Log in to leave a comment
I set on a mission to turn my current code into fully object oriented code. I ended up:
Deck class which contains a vector of Card objects, has a shuffle method, and a deal methodHand class, which these methods: total, add, show_cards, is_bust, is_blackjack
Log in to leave a comment
I realised that the reason I decided to learn C++ was because I wanted to learn object-oriented programming, but the code I was writing wasn’t very object-oriented at all. So I decided to start refactoring my code to make it more object-oriented.
I learnt about:
enum, and created a suit and rank enumclass with private attributes and public methodsstatic_cast<int> to get the numeric value of an enumThis refactor made me realise how object-oriented design can make the code more readable, reusable, and easier to expand.
Log in to leave a comment
In the last hour, I’ve implemented a basic BlackJack game where:
Log in to leave a comment
This is the first devlog of this project, which is intended to be a console based blackjack game.
This is my first C++ project, so I hope to learn the syntax and how it works through building this.
The first thing I implemented was a card shuffling algorithm, and this was by converting an algorithm I had in Python, into C++. Through this, I learnt a lot about vector and random number generation.
Log in to leave a comment
I noticed that the layout might be fixed if I scrape HTML instead of text and render the HTML inside the content.
I implemented this change and immediately saw it looks much better now, and more like the spec format.
I also added Google Analytics so I can see how many people use this website and for how long.
Log in to leave a comment
I realised that on the website the text doesn’t look so good, so I decided to scrape the HTML instead of turning it into text first.
This worked greatly as now it looks much better on the website now.
Log in to leave a comment
Most of the time I’ve spent on this project won’t show because it’s been mostly work on pen and paper.
Things I’ve done
localStorage
Log in to leave a comment
This is the first step to creating a todolist from my A Level spec, and I’m really happy I’ve finished this part.
Now using the JSON I’ve created, I’m going to turn it into a todolist app, but specifically towards the subjects I’m doing.
h4 tags as well as h3 tags)json to a json fileAlthough this parser was made specific to physics AQA, I tried it on Psychology, and it didn’t work because it doesn’t use tables.
Then I tried it on CS (which does use tables), but it uses multiple rows, so when I ran the code it only worked for the first rows of each table.
I need it to work for any AQA specification which uses tables (even if they are multi rows).
Instead of
subtopic: {"content": "", "opp": ""}
I should do
subtopic: [{"content": "", "opp": ""}, {"content": "", "opp": ""}, {"content": "", "opp": ""}]
(so an array of each content and opportunity row)
This was a really good hour, and I got a lot done.
Log in to leave a comment
I’ve started off with trying to scrape AQA A level Physics (hoping this will work for all AQA specs once this fully works).
So far, I’ve implemented scraping the subtopics from a topic page, which gets the contents + opportunities of each topic, when given the URL. It turns this into JSON and outputs this.
The next step is to get all the topic URLs from the page and scrape all of them.
Log in to leave a comment
This is my first project in C, and I’m really proud of it, because now it can do exactly what I wanted to learn C for: memory management to create special data structures that I can manipulate myself.
The benchmark stats look great, and it’s nice to know hash tables are actually simple to implement, but also reduce operation time a lot.
I implemented hash table from start to finish, it was very simple as it was just an array of linked lists.
load function to load the data from the text fileunload function to free all the memory so there are no memory leaksadd_data function to add a data entry to the hash tabledisplay function to display all the data entries in the hash tablesearch_data function to find a specific data entry in the hash tableamend_data function to amend the score of a specific data entry in the hash tableremove_data function to remove a specific data entry in the tableThe output below is the same as in linked lists, hopefully hash table is actually faster.
Next entry will be about comparing hash tables, linked list, and dynamic array.
Log in to leave a comment
I’ve decided to not include sorting in this project.
load function in linked lists, which initialises a linked list with the data in the text file providedunload function, which frees all the memory in the linked listdisplay function, which displays all the data in the linked list
Log in to leave a comment
After getting rejected twice because people couldn’t run the code easily enough I didn’t lose hope.
I added example functions in each python file, and created a main executable file (in the cli) that can be accessed and ran easily.
Log in to leave a comment
I shipped v1.0.0 of Stem Sims: a collaborative, open source collection of mathematical simulations, implemented across different programming languages.
This was a very fun project for me, as I love integrating maths with programming, and I made really cool models like a text prediction model trained on the novel Jane Eyre, and a model of Google Page Rank.
Hopefully this release marks the start of collaborations on the repo, and this can grow further!
Log in to leave a comment
Hopefully this is the penultimate devlog for the dynamic array data structure.
This morning I:
amend_data function, which amends the score of a user in the dynamic arraymain function so it’s readableremove_data function, which deletes the data entry of the user with the username given as a parameter, and returns the pointer to the new memorychar username[50] to const char *username in most places, since I don’t want it to changesscanf
remove_data, since it’s not neededNow all that’s left to do is create the sort_data function, in which I’m planning on using merge sort.
Log in to leave a comment
add_data function which adds a data entry to the dynamic entry, and returns the new pointersearch_data function which searches for the score of the user with the username given in the parameter
Log in to leave a comment
load function more robust so it increments size more logically, and it closes files if a pointer fails to be createdunload function, which simply contains one line to free the pointer (dynamic arrays are easy to free)display function which goes through all the entries in the dynamic array and displays each one
Log in to leave a comment
split function, but I can parse the data from the text file nowunload function, which I’m going to code next
Log in to leave a comment
I’ve changed the idea of this project a little, although it’ll still be exploring memory in C
The project will contain a data type of a leaderboard entry, and I’ll include different ways of storing multiple leaderboard entries as different data structures.
I’ll definitely be doing:
And I’m also planning on researching and implementing 2 others.
I’ve started working on the dynamic array, and have structured out the different functions that I’ll need to implement
Log in to leave a comment
Log in to leave a comment
Log in to leave a comment
it works great, but some sentences are an extract from the book, so i want to increase the accuracy and randomness
Log in to leave a comment
i’m going to make a text prediction model using the mathematics behind markov chains
Log in to leave a comment
Log in to leave a comment
Log in to leave a comment
this is such an interesting concept for a project, cool stuff bro :)
QUESTION: is the 2nd intro tip triangle enough for the ui? or should i have an arrow which points to the bar?
Log in to leave a comment
i’ve decided to pivot this a little, and instead of it being a flask app of maths simulations, i want it to be a collaborative, open source collection of mathematical simulations implemented in multiple programming languages.
so i’ve shifted the programs into respective folders, deleted the flask app, and added coin_toss.swift and coin_toss.js.
going to start asking for collaborators now!
Log in to leave a comment
Log in to leave a comment
@AppStorage to determine which page of onboarding the user is onLog in to leave a comment
Log in to leave a comment
CircuitGate
CircuitGate uses the global inputs A and B as input, and react to them, green dot for 1 and grey dot for 0i wanted to make something for the borked ui game jam (and win some cookies hopefully), but didn’t have a lot of time, so i aimed to build a stupid and useless ui in an hour
i ended up building a really simple website with 7 useless components and comic sans aimed to irritate the user
the components are:
i think this is good enough, and it took a little over an hour
the target is to get this done in 1 hour (20 minutes done already)
Log in to leave a comment
Log in to leave a comment
people always share stories about their successes but never about their failures, even when you can honestly learn more from failures.
saasheaven is an open source website where you can create a pull request to add your own story, and all failed saas stories show up in the post-mortems page of the website
it was my first collaborative open source project, and although i haven’t gotten any pull requests, i got over 60 stars and 1k website visits, definitely something i didn’t expect
added ad slots (in one i advertise my newsletter)
added metadata + favicon + opengraph data
made the code more readable
checked out analytics from last week and apparently i got over 1k website visitors in a week
Log in to leave a comment
added an api to fetch all post-mortems and a specific post-mortem
Log in to leave a comment
had an idea, built a simple landing page, made a github api so that the repo acts as a database for all the post-mortems, then hosted
sadly i don’t think hackatime worked properly and i didn’t get all the time recorded
Log in to leave a comment
started the project
made the logic gate structure which will calculate the output from different gates and inputs
added a simple canvas where the 4 gates are draggable
Log in to leave a comment