Activity

Vulcan

First devlog

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!

Attachment
0
Vulcan

Shipped this project!

Hours: 10.05
Cookies: 🍪 53
Multiplier: 5.27 cookies/hr

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.

Vulcan

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!

Attachment
0
Vulcan

Second last devlog (probably)

I wanted the code to be as good as possible, so I:

  • removed the case sensitivity from hit + stand
  • added saving and getting highscore from a text file
  • added the 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!

Attachment
0
Vulcan

Personality Types

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.

Attachment
0
Vulcan
  • To make it more object oriented, I added the user’s hand to player to make the code more abstract.
  • Then I found a bug which meant that you could bet negative money, so I fixed that bug
  • I added methods like add_card to Player, and made Player.hand private, which meant that the code is better encapsulated.
  • I also added a more efficient card shuffling algorithm using std::shuffle
  • Then I spent 1 hour playing the game with the friends so that they could test it out and give me feedback
Attachment
0
Vulcan

Adding a Player class

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.

Attachment
0
Vulcan

Making my code object oriented

I set on a mission to turn my current code into fully object oriented code. I ended up:

  • creating a Deck class which contains a vector of Card objects, has a shuffle method, and a deal method
  • creating a Hand class, which these methods: total, add, show_cards, is_bust, is_blackjack
  • in the main function, I implemented the main code game using the classes I had defined before
Attachment
0
Vulcan

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.

What I learnt:

I learnt about:

  • enum, and created a suit and rank enum
  • creating a Card class with private attributes and public methods
  • using member functions to convert enums to strings
  • constructors, including a default constructor and a parameterised constructor
  • switch statements for handling multiple cases
  • the use of static_cast<int> to get the numeric value of an enum

Next steps:

  • I want to create a Deck class that contains a vector of Card objects
  • Implement shuffling and dealing methods for the deck
  • Start building simple game logic, like blackjack, using these classes

This refactor made me realise how object-oriented design can make the code more readable, reusable, and easier to expand.

Attachment
0
Vulcan

Blackjack Game

In the last hour, I’ve implemented a basic BlackJack game where:

  • you start off with 2 cards
  • you hit until you’re busted or stand
  • if you’re busted you lose
  • else the dealer hits until they cross 17
  • if the dealer busts they lose
  • else the higher total (between the user and the dealer) determines who the winner is
Attachment
0
Vulcan

First devlog: Card Shuffling

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.

Attachment
0
Vulcan

I fixed the text-prediction running error since it didn’t seem to work on the executable page.

I also fixed the github action to fit this.

Attachment
0
Vulcan

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.

Attachment
0
Vulcan

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.

Attachment
0
Vulcan

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

  • I’ve wireframed the full website from the basics, from what pages, what buttons, what functionality, how auth will work and storage
  • I designed what I wanted the website to be like, then because I need to make this before exam revision starts (in a few days), I put it into v0
  • I then understood what code it outputted, and edited it so that it saves the progress using localStorage
  • Finally, I hosted it on Vercel after buying the domain on Porkbun and setting up SSL for custom domain
Attachment
0
Vulcan

Shipped this project!

Hours: 1.67
Cookies: 🍪 9
Multiplier: 5.48 cookies/hr

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.

Vulcan

I made the scraper fully work for AQA Physics A level

  • I added code to get all the topics from a subject content page using the a tags and href
  • Then I scraped each topic page individually using the topic scraping code I had before
  • Then I realised some topics have subsubtopics instead of just subtopics, so I added code to account for those situations (looking for h4 tags as well as h3 tags)
  • I made it upload the json to a json file
  • I tested the code on AQA Physics A level and it fully worked!

Testing on another subject

Although 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.

Next steps

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)

Summary

This was a really good hour, and I got a lot done.

Attachment
0
Vulcan

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.

Attachment
0
Vulcan

Shipped this project!

Hours: 7.34
Cookies: 🍪 28
Multiplier: 3.83 cookies/hr

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.

Vulcan

Benchmarking is done

  • I added header files for each data structure
  • I created 783 data entries in the text file
  • MOST IMPORTANTLY I FINISHED THE BENCHMARKING LOGIC

Moral of the story: Hash Table is the best (it logically makes sense as well)

Attachment
0
Vulcan

First and Last Devlog of Hash Table

I implemented hash table from start to finish, it was very simple as it was just an array of linked lists.

  • I created the load function to load the data from the text file
  • I created the unload function to free all the memory so there are no memory leaks
  • I created the add_data function to add a data entry to the hash table
  • I added the display function to display all the data entries in the hash table
  • I added the search_data function to find a specific data entry in the hash table
  • I added the amend_data function to amend the score of a specific data entry in the hash table
  • I added the remove_data function to remove a specific data entry in the table
  • I added comments to make my code readable

The 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.

Attachment
0
Vulcan

Last Devlog of Linked Lists

I realised I had a really weird insertion logic, so I changed it to just appending at the head, rather than second place in the list.
I also fixed some memory issues in the code

Attachment
0
Vulcan

Second Devlog of Linked Lists

  • I created an add_data function to add a data entry to the linked list
  • I created a remove_data function to remove a data entry from the linked list
Attachment
0
Vulcan

I’ve decided to not include sorting in this project.

First Devlog of Linked Lists

  • I created a load function in linked lists, which initialises a linked list with the data in the text file provided
  • I created an unload function, which frees all the memory in the linked list
  • I created a display function, which displays all the data in the linked list
Attachment
0
Vulcan

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.

Attachment
0
Vulcan
  • I changed the README so that it includes instructions on how to run the code
  • I fixed a bug in card-shuffling python
  • I committed the Jane Eyre text so that text-prediction will work
Attachment
0
Vulcan

Shipped this project!

Hours: 7.54
Cookies: 🍪 109
Multiplier: 14.51 cookies/hr

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!

Vulcan
  • i made some changes in the python card shuffling code so it doesn’t repeat stuff
  • i wrote code for card shuffling in javascript
  • i wrote code for random walk in javascript
Attachment
Attachment
0
Vulcan

Ripple shuffle

  • I created an implementation of ripple shuffle, which uses binomial distribution to split the deck into approximately half, uses the number of cards in each half to shuffle the deck, and then uses the idea of markov chains to continue shuffling the deck multiple times
Attachment
0
Vulcan

5th Devlog of Dynamic Arrays

Hopefully this is the penultimate devlog for the dynamic array data structure.

This morning I:

  • created an amend_data function, which amends the score of a user in the dynamic array
  • spaced out the main function so it’s readable
  • added a remove_data function, which deletes the data entry of the user with the username given as a parameter, and returns the pointer to the new memory
  • changed char username[50] to const char *username in most places, since I don’t want it to change
  • found a more efficient way of splitting line into score and username using sscanf
  • removed memory allocation from remove_data, since it’s not needed

Now all that’s left to do is create the sort_data function, in which I’m planning on using merge sort.

Attachment
Attachment
Attachment
0
Vulcan

4th Devlog of Dynamic Arrays

  • I added the add_data function which adds a data entry to the dynamic entry, and returns the new pointer
  • I added the search_data function which searches for the score of the user with the username given in the parameter
  • I added comments to the functions for readability
Attachment
Attachment
0
Vulcan

3rd Devlog of Dynamic Arrays

  • I made the load function more robust so it increments size more logically, and it closes files if a pointer fails to be created
  • I added an unload function, which simply contains one line to free the pointer (dynamic arrays are easy to free)
  • I also added a display function which goes through all the entries in the dynamic array and displays each one
Attachment
Attachment
0
Vulcan

2nd Devlog of Dynamic Arrays

  • I’ve almost finished coding the load function, which reads the data from a text file and adds it to the dynamic array
  • I got a little sidetracked by creating my own implementation of a split function, but I can parse the data from the text file now
  • I’m aware of the memory leaks, but I will handle that in the unload function, which I’m going to code next
Attachment
Attachment
0
Vulcan

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:

  • Hash Table
  • Dynamic Array
  • Linked List

And I’m also planning on researching and implementing 2 others.

Today’s Update

I’ve started working on the dynamic array, and have structured out the different functions that I’ll need to implement

Attachment
0
Vulcan
  • i tested my app on simulator and used accessibility inspector to make sure the colour contrast was accessible enough
  • i also tested common accessibility options in the app, and saw that it looks fine with all of the options
  • i changed the highlight colour to make it look better
0
Vulcan
  • i changed the highlight to black and white (still debating whether this looks good or not though)
  • made the tip sheet a modal so you can focus more as blurred background
Attachment
0
Vulcan
  • i switched from a 3 words -> 3 words markov chain to a 3 -> 1 word markov chain
  • i somehow managed to decrease the run time from 5 minutes to 2 seconds
  • i split the code into subroutines so it is easier to read and understand
Attachment
0
Vulcan
  • i added the code for cleaning the text before markov chain generation
  • i added the code for text prediction
  • i texted it out with jane eyre

it works great, but some sentences are an extract from the book, so i want to increase the accuracy and randomness

Attachment
0
Vulcan

i’m going to make a text prediction model using the mathematics behind markov chains

  • i’ve broken down problem into phrases, mainly training and text prediction, and broken these down into steps
  • i’ve written the code for generating the markov chain during training
Attachment
0
Vulcan
  • i spent 20 minutes trying to make it responsive on ipad, then realised this app isn’t meant for an ipad anyway (who would use an ipad on a crowded train?)
  • i checked the spacing on different iphones to see if it worked out, and it did

question: does the dark mode colour scheme for highlight + button look good? what about light mode?

Attachment
Attachment
0
Vulcan
  • made the speech bubble + arrow a custom shape so it looks nicer
Attachment
1

Comments

chefpenguino
chefpenguino about 2 months ago

this is such an interesting concept for a project, cool stuff bro :)

Vulcan
  • i added a 4th intro tip to end the intro
  • i made the last intro tip disappear when the user clicks any point on the screen
  • i moved the locations of the speech bubbles a little
  • i tested the onboarding on different phones

QUESTION: is the 2nd intro tip triangle enough for the ui? or should i have an arrow which points to the bar?

0
Vulcan

PIVOT

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!

Attachment
0
Vulcan
  • added text to the welcome page
  • made the intro tips go from one tip to the next when buttons are pressed (after holding breathe button) or events are finished (the breathe bar goes back down)
0
Vulcan

what i did:

  • instead of having 3 pages for onboarding, i’ve decided on having a welcome page and then an interactive demo of the ui
  • i removed the last 2 pages of onboarding and kept the welcome one
  • i added highlight states to the 3 main ui parts, and added speech bubbles which explain the ui

TODO:

  • i need the speech bubbles to be in a better position than right now
  • i need the arrows to be in better positions
  • i want the welcome page to have some text
  • the intro tips should go from one tip to the next without me having to manually do it
Attachment
Attachment
Attachment
0
Vulcan
  • added the onboarding logic, which uses @AppStorage to determine which page of onboarding the user is on
  • added placeholder content on each onboarding page
  • added a button on the main page which redirects back to the first onboarding page
0
Vulcan
  • added some positive affirmations on both pages
  • changed the whole case to lowercase since it’s more calming
Attachment
Attachment
0
Vulcan
  • started working on design
  • added a nice background for both light and dark modes
  • made the text and buttons look nicer for both themes
  • downloaded the app on my phone so i can test properly
Attachment
Attachment
0
Vulcan
  • i filled the tips page with tips and added some basic styling
  • i also added a sheet which acts as a focus page for a specific tip
0
Vulcan
  • i made the bars actually go up and down, rather than start from the middle
  • i added an extra red bar which shows up when you’ve inhaled for more than 40 seconds
0
Vulcan
  • i decided i’m going to change 4 bars to 1 bar, to ease simplicity
  • made the bar go up and down based on when you are holding/releasing it
  • made the text on the button change to help you breathe
0
Vulcan
  • i wanted to add a tips page, so i figured out how to add navigation
  • i added 4 bars to the sides of the hold button, so i can work on the bar filling up while holding implementation
0
Vulcan
  • i learnt the basics of c
  • i decided i want to make a project which contains several programs that manage memory
  • i started working on the grade book program (the first one)
Attachment
0
Vulcan
  • i came up with the idea for an app for the swift student challenge
  • i designed how i want the main page to be, and the features in it
  • i coded a button which detects when it is being held down
0
Vulcan
  • instead of using different structs for each gate, i used a shared gate struct called CircuitGate
  • the CircuitGate uses the global inputs A and B as input, and react to them, green dot for 1 and grey dot for 0
  • moving the gates work, but it doesn’t affect anything
1

Comments

Lenny
Lenny 23 days ago

Hi, check out my website flowline.app.

Vulcan
  • added an api route (post) for page rank which returns each page’s rank as a percentage in JSON
  • created a function for coin toss
  • created an api route for coin toss
  • created a visualisation route for coin toss
Attachment
Attachment
0
Vulcan

i created the algorithm for google page rank

Attachment
0
Vulcan

Shipped this project!

Hours: 1.07
Cookies: 🍪 4
Multiplier: 3.3 cookies/hr

i 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

Vulcan

added random but annoying components which all look terrible

the components are:

  • a clicker counter that does nothing
  • text that spins
  • a button that runs from your cursor
  • a search bar that does absolutely nothing (keeping the grid layout)
  • upside down text which tells you to spin your laptop around
  • a random fact button which tells you useless things like “You just wasted your time!”
  • a navigation bar that randomly drifts around your screen
  • a form which resets 3 seconds after you start filling it in

i think this is good enough, and it took a little over an hour

1

Comments

sanadeghat
sanadeghat 2 months ago

oh its so pretty, just stunning

Vulcan

the target is to get this done in 1 hour (20 minutes done already)

  • created the nextjs repo for the project
  • made comic sans the font because everybody hates comic sans
  • added bright neon colours because all devs use dark mode
  • added a clown cursor because clowns are scary
Attachment
0
Vulcan
  • i created the simulation code for a random walk which returns all the x and y points while the walk occurs
  • i created a flask app
  • i added an api route so that others can fetch the random walk data
  • i used matplotlib to generate an image for 5 different random walks, and added a route to see the visualisation image
Attachment
Attachment
0
Vulcan

Shipped this project!

Hours: 2.16
Cookies: 🍪 46
Multiplier: 21.2 cookies/hr

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

Vulcan

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

Attachment
Attachment
0
Vulcan

added an api to fetch all post-mortems and a specific post-mortem

Attachment
0
Vulcan

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

Attachment
Attachment
0
Vulcan

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

0