Friday, 15 December 2023
Dev Log // Fun Times With Github Copilot, GPT and Solitaire
Thursday, 2 November 2023
Chapter 27 // Exercise 16 - Principles & Practice Using C++
I've been feeling a bit nostalgic lately and going back over books I bought way back in 2016 and 2017 as well as reading my green text on the early exercises of P&P posted on here. I read a chapter 4 post and the memories of that night came flooding back to me. It took me 6 hours to write a function comparing the size of two ints. It was 3am and I was so frustrated I started crying. I developed a fear of bools. Its absolutely hilarious to me now as I sit here reading a random book, silently ripping apart the authors code because they stored an pointer to an enum.
My mantra at work is "git gud". I can relax a bit when I've "gitten gud", then I can "git gudder". I honestly believed I hadn't really changed at all but lately I've started to realise that I can "just do stuff now". 6 years ago I bought Programming Game AI by Example by Mat Buckland. I tried to read it and follow along with the code but it went completely over my head as I had no experience with inheritance and I was convinced OOP was evil (because I didn't want to understand it). Recently, I picked the book back up and not only implemented the code from snippets with no problem but changed it as I was going along, grumbling about the authors use of singletons and lack of interfaces.
2 years ago I read the online book Ray Tracing in one Weekend and attempted to multi-thread it. It was a disaster and no matter how many times I read MSDN or StackOverflow I just couldn't get my attempts to work. Earlier this year I had another go and got a hacky version working in an afternoon. It's not perfect but it worked and I just "knew" how to do it.
3 months after starting as an intern at Rare, I asked a senior in a catch-up "when do you stop feeling like shit?" and his response was "you don't, but over time it won't be as bad". I pressed him for an actual time for "over time" and he just laughed and said "3 years". It's been 4 years since I asked him that.
It took me a very long time to stop feeling like a waitress/receptionist and start thinking of myself as a programmer.
Thank you Bjarne for giving me the tools to change my life.
Wednesday, 1 November 2023
Chapter 27 // Exercise 15 - Principles & Practice Using C++
Tuesday, 31 October 2023
Chapter 27 // Exercise 14 - Principles & Practice Using C++
Monday, 30 October 2023
Chapter 27 // Exercise 13 - Principles & Practice Using C++
Sunday, 29 October 2023
Chapter 27 // Exercise 12 - Principles & Practice Using C++
Representation: I chose an array of struct pairs because it keeps the key-value pairs together, which makes it more intuitive.
Return Types: For find(), I return the int value associated with the key. If the key isn't found, I' return a special value, like -1.
For remove(), I return 0 if the key was successfully removed and -1 if the key was not found.
Handling Collisions: For simplicity, I handled simple collisions only. This means the table has a fixed size, and if it's full, you can't insert more items.
Capacity: The table has a fixed size, which for this example, is set to 100. it will wrap round to find free slots but after that it won't insert any more.
Saturday, 28 October 2023
Chapter 27 // Exercise 10, 11 - Principles & Practice Using C++
- Inline Functions: Initially a C++ thing, it lets you suggest to the compiler that a function should be inlined for performance.
- Single-line Comments: I believe // was first used in B, then brought back in C++ because /**/ is tedious.
- Variable Declaration Anywhere: Instead of only at the beginning of blocks, you can now declare variables anywhere in C, much like in C++.
- Mixed Declarations and Code: Kinda related to the previous one. You can intermix variable declarations with executable code.
- Boolean Type (_Bool or bool with stdbool.h): I was shocked the first time I tried to use a bool in C and found out it had to be added to the language in C89.
- Compound Literals: Lets you create temporary structures or arrays in the middle of an expression, similar to how you'd do in C++.
- Designated Initializers: A more expressive way to initialize struct or array members.
- Static Assertions (_Static_assert): Helps catch errors at compile-time based on constant expressions.
- Complex Number Support (_Complex and _Imaginary): C has built-in support for complex numbers, while C++ relies on the std::complex template class.
- Different Treatment of inline Functions: In C, an inline function's definition can be present in multiple translation units. In C++, inline functions have external linkage by default, but in C they have internal linkage.
- Allowing Implicit Function Declarations: Older versions of C allowed functions to be called without a previous declaration (not recommended, though!). C++ never allowed this.
- Named Address Spaces: Some C compilers for specific platforms (like embedded systems) support this feature, but it's not a part of C++.
- Non-constant Aggregate Initializers: In C, global and static aggregates can be initialized with non-constant values. C++ doesn't allow this.
Friday, 27 October 2023
Chapter 27 // Exercise 9 - Principles & Practice Using C++
Thursday, 26 October 2023
Chapter 27 // Exercise 8 - Principles & Practice Using C++
Wednesday, 25 October 2023
Chapter 27 // Exercise 6, 7 - Principles & Practice Using C++
Tuesday, 24 October 2023
Chapter 27 // Exercise 4, 5 - Principles & Practice Using C++
Wednesday, 27 September 2023
Chapter 27 // Exercise 2, 3 - Principles & Practice Using C++
Friday, 22 September 2023
Unreal Free For The Month Jam // September 2023 - Escape The Palace Hall
Monday, 28 August 2023
Chapter 27 // Exercise 1 - Principles & Practice Using C++
Monday, 24 July 2023
Dev Diary // FLTK & Tetris Part 2
Thursday, 20 July 2023
Chapter 27 // Drill 1, 2, 3 - Principles & Practice Using C++
Wednesday, 19 July 2023
Chapter 26 // Exercise 12, 13, 14 - Principles & Practice Using C++
Tuesday, 18 July 2023
Chapter 26 // Exercise 11 - Principles & Practice Using C++
Monday, 17 July 2023
Chapter 26 // Exercise 9, 10 - Principles & Practice Using C++
Sunday, 16 July 2023
Chapter 26 // Exercise 8 - Principles & Practice Using C++
Saturday, 1 July 2023
Chapter 26 // Exercise 7 - Principles & Practice Using C++
Friday, 30 June 2023
Chapter 26 // Exercise 6 - Principles & Practice Using C++
Monday, 15 May 2023
Chapter 26 // Exercise 5 - Principles & Practice Using C++
Monday, 8 May 2023
Ray Tracing In One Weekend // Making it Multi-threaded
https://lptcp.blogspot.com/2021/02/ray-tracing-in-one-weekend-review.html
Tuesday, 18 April 2023
Dev Diary // Using ChatGPT to make an Idle Clicker Game
Monday, 17 April 2023
Chapter 26 // Exercise 4 - Principles & Practice Using C++
Then, the user could just create a vector<TestSequences> and pass through whatever sequence type they want like:
All you have to do then is create a TestSequence, give it a type, set the sequence type and then load in the text file.