r/cs2a • • Feb 09 '24

zebra Loopying Zebra- Whats a Header file?

0 Upvotes

So in this Quest its stating we need to add our first header file? Does that require us to just

So in this Quest, it states we need to add our first header file. Does that require us to just


r/cs2a • • Nov 02 '23

Projex n Stuf Discord Bot!

1 Upvotes

Hey everyone,

Discord bots have been a great way from my personal experience to learn programming. During covid, in 2021, I started building simple python discord bots. Some of these bots have grown to enormous sizes being enlisted in servers with hundreds of thousands of people. Ive looked into the possibilities of building discord bots in c++, and it is possible with some apis such as D++.

For me, hands-on experience beats online exercises on platforms such as leetcode and stuff. If you would like to give it a shot, no matter your experience or skill level, please vote on the poll attached to this post and maybe we can get started!

For reference, here is one of my recent discord bots that I made for a hackathon in python.

5 votes, Nov 09 '23
4 Yes, I would be interested! :)
1 No, I would not be interested. :(

r/cs2a • • Apr 17 '25

platypus Progress Report 8/9

0 Upvotes

Finished blue quest 8 yesterday and finally finished blue quest 9 today. Understanding the concept behind blue quest 9 was a slow burn for me, never once did it just "click" all at once. My advice is to just sit down with a pen and paper, and draw out example lists. I drew a square for my _SENTINEL_ node, solid dots for any "real" nodes, and an open circle for the nullptr at the end of the list. Start with an empty node (so just _SENTINEL_ and nullptr) and then make a list below it with one node, so in order: {_SENTINEL_, new_node, and nullptr}. Keep track of the _head, _tail, and _prev_to_current members and also use a different color pen to draw lines showing which nodes point to which nodes as their "next" member. When it came time to make the implementations for certain member functions, I would go back to drawing out example lists on paper to try to visualize I was doing. I wish I'd done the drawings sooner, I brute-forced my way through the first couple functions by picturing it all in my head and testing it thoroughly (though not always thoroughly enough) in main. Drawing things out made it a lot simpler.

My first couple submissions didn't work, and I would find myself making a lot of assignment and check errors in my code. When I needed to update the value of say _tail to something, I would occasionally mess up and assign the value of that something to _tail. I caught a few instances of me using "=" when I should have been using "==". If you're getting errors or unintended results in your code, check for these things. You wouldn't want to rewrite the entire code for your function, thinking you had the wrong general idea when all you had to do was change "=" to "==" or "if (this == that) {}" to "if (that == this) {}."


r/cs2a • • Oct 11 '24

General Questing Quest Grading - Sdiff

0 Upvotes

Hello! On the zoom it was mentioned that each quest is graded using sdiff.

The sdiff command uses the output of the "diff" command to show two files side by side, and the sdiff indicates lines that are different.

These are the ways in which differences/similarities are shown:

  • A | line, or a blank line in the middle is printed between the lines if they are identical.

  • A < is shown in the middle if the line appears only in filename1 .

  • A > is shown in the middle if the line appears only in filename2 .

  • A ! is shown between the lines if they are different.


r/cs2a • • Sep 15 '24

Foothill Self-introduction

1 Upvotes

Hello everyone my name is :

01011000

01101001

01100001

01101110

01100111

01000011

01101000

01100101

01101110

01100111

It is very clear. They are binary, but I noticed someone use Hexadecimal to introduce himself. So I want to do the same thing as him. And if you don't want to convert them one by one by a sheet of binary. Maybe you can use computer to help you finish them. I spend 2 days to learn how to transfer letters to binary and I find that making letters become binary is not so difficult, but opposite is difficult.

And if you get a strange string, you are right. Because Chinese names always strange.

Happy programing!


r/cs2a • • May 04 '24

starling Problems with quest error messages

0 Upvotes

I got the following error message from quest 3 that MAKES ABSOLUTELY NO sense. It compiles and runs on visual studio, it runs on onlineGDB and the answers are correct. The error messages says that there are multiple definitions of Main. WHAT THE HECK IS THAT??? There clearly is only one main function. Anyone seen this error before? what are these codes .text+0x1c5 how can you debug code when you don't know what the error message means. Can I please get a copy of the manual of the grader software?

If there were build errors, you can see the first 10 lines below.
Alas! Compilation didn't succeed. You can't proceed.
/tmp/ccJoPpsp.o: In function `main':
Branching_Functions.cpp:(.text+0x1c5): multiple definition of `main'
/tmp/ccSgsE48.o:main.cpp:(.text+0xf8): first defined here
collect2: error: ld returned 1 exit status

r/cs2a • • Feb 20 '25

Blue Reflections (Post Hoc) Week 6 Reflection - Wenxi "Reynard" Tang

0 Upvotes

This post indicates my resumption of my committment to posting at least one post a day for the rest of the course. By taking the midterm last week, I realize one of my weaknesses is to distinguish different types of errors, so I will briefly rephrase what each type of error mean. Logic error means that although the program does not display error messages, the program will produce results that are not in accord with the programmer's intention due to flawed logic. One common logic error is having (x=some number) instead of (x==some number) for conditionals, in which the former assigns a number and the latter compares the numbers. Compiler error, or syntax error, as the name implies, prevents the program from compiling due to syntax error, in which common mistakes include forgetting semicolon(;) or data type mismatching with the assigned value(e.g. int x= "aha";). Runtime error occurs when the program is running and causes the program to crash or produce unexpected results; common causes include dividing any number by 0 (int c= 10/0;), array's index being out of bounds, and invalid memory access. So the program will compile, but it may not even produce results. Style error is not a formal error, but it affects readability and should be minimized. Some common mistakes include missing brackets and spaces between lines of code for easier comprehension. In summary, I need to go to office hours and zoom sessions more often to catch up on some basic concepts.


r/cs2a • • Feb 20 '25

zebra A Late Analysis on Quest 4 Miniquest 6 Reflection, Specifically about decimal places

0 Upvotes

I would speculate many of us have countered this problem in the miniquest of calculating geometric terms, where the first argument's digits change in the decimal places, resulting in a failed checkpoint. One hint I would divulge is that although getstring() is handy, but it would truncate the decimal places, resulting in an erroneous first term with less decimal places followed by inaccurate terms due to less decimal places. Stringstream is a better alternative. I would recommend jotting down the basic logic of this mini program on a piece of paper, and use it to examine your code. Always expect the unexpected and use conditionals for them, especially when it comes to user input.


r/cs2a • • May 21 '24

zebra autograde

0 Upvotes

Be"H

cleared all the build errors

now i don't know what to do that the autograder is counting it against me that its number generator is not generating the same value as mine every time

Failed checkpoint. I tried to play your game a few times.Failed checkpoint. I tried to play your game a few times.

Below, to the left, is how our interaction went.
To the right of it is how I expected it to go (sdiff formatting).

Welcome to my number guessing gameWelcome to my number guessing game

Enter your guess: Enter your guess: 
You entered: 8You entered: 8
Enter your guess: Enter your guess: 
You entered: 6You entered: 6
Enter your guess: Enter your guess: 
You entered: 9You entered: 9
Enter your guess: Enter your guess: 
You entered: 4You entered: 4
Welcome to my number guessing gameWelcome to my number guessing game

Enter your guess: Enter your guess: 
You entered: 1You entered: 1
You found it in 1 guess(es).   |Enter your guess: 
   >You entered: 3
   >Enter your guess: 
   >You entered: 7
   >Enter your guess: 
   >You entered: 10
Welcome to my number guessing gameWelcome to my number guessing game

Enter your guess: Enter your guess: 
You entered: 9You entered: 9
Enter your guess: Enter your guess: 
You entered: 3You entered: 3
Enter your guess: Enter your guess: 
You entered: 5You entered: 5
Enter your guess: Enter your guess: 
You entered: 7You entered: 7
Welcome to my number guessing gameWelcome to my number guessing game

Enter your guess: Enter your guess: 
You entered: 4You entered: 4
Enter your guess: Enter your guess: 
You entered: 2You entered: 2
Enter your guess:    |You found it in 2 guess(es).
You entered: 8   <
Enter your guess:    <
You entered: 3   <
Welcome to my number guessing gameWelcome to my number guessing game

Enter your guess: Enter your guess: 
You entered: 9You entered: 9
Enter your guess: Enter your guess: 
You entered: 8You entered: 8
Enter your guess: Enter your guess: 
You entered: 5You entered: 5
Enter your guess: Enter your guess: 
You entered: 8You entered: 8
Welcome to my number guessing gameWelcome to my number guessing game

Enter your guess: Enter your guess: 
You entered: 4You entered: 4
Enter your guess: Enter your guess: 
You entered: 3You entered: 3
Enter your guess: Enter your guess: 
You entered: 7You entered: 7
Enter your guess: Enter your guess: 
You entered: 10You entered: 10
Welcome to my number guessing gameWelcome to my number guessing game

Enter your guess: Enter your guess: 
You entered: 4You entered: 4
Enter your guess: Enter your guess: 
You entered: 6You entered: 6
Enter your guess: Enter your guess: 
You entered: 7You entered: 7
Enter your guess: Enter your guess: 
You entered: 4You entered: 4
Welcome to my number guessing gameWelcome to my number guessing game

Enter your guess: Enter your guess: 
You entered: 4You entered: 4
Enter your guess: Enter your guess: 
You entered: 10You entered: 10
Enter your guess: Enter your guess: 
You entered: 6You entered: 6
Enter your guess: Enter your guess: 
You entered: 1You entered: 1
Welcome to my number guessing gameWelcome to my number guessing game

Enter your guess: Enter your guess: 
You entered: 6You entered: 6
Enter your guess:    |You found it in 1 guess(es).
You entered: 7   <
Enter your guess:    <
You entered: 10   <
Enter your guess:    <
You entered: 1   <
Welcome to my number guessing gameWelcome to my number guessing game

Enter your guess: Enter your guess: 
You entered: 5You entered: 5
Enter your guess: Enter your guess: 
You entered: 5You entered: 5
Enter your guess: Enter your guess: 
You entered: 3You entered: 3
Enter your guess: Enter your guess: 
You entered: 7You entered: 7
You cannot proceed in your quest until you clear this roadblock.


Below, to the left, is how our interaction went.
To the right of it is how I expected it to go (sdiff formatting).

Welcome to my number guessing gameWelcome to my number guessing game

Enter your guess: Enter your guess: 
You entered: 8You entered: 8
Enter your guess: Enter your guess: 
You entered: 6You entered: 6
Enter your guess: Enter your guess: 
You entered: 9You entered: 9
Enter your guess: Enter your guess: 
You entered: 4You entered: 4
Welcome to my number guessing gameWelcome to my number guessing game

Enter your guess: Enter your guess: 
You entered: 1You entered: 1
You found it in 1 guess(es).   |Enter your guess: 
   >You entered: 3
   >Enter your guess: 
   >You entered: 7
   >Enter your guess: 
   >You entered: 10
Welcome to my number guessing gameWelcome to my number guessing game

Enter your guess: Enter your guess: 
You entered: 9You entered: 9
Enter your guess: Enter your guess: 
You entered: 3You entered: 3
Enter your guess: Enter your guess: 
You entered: 5You entered: 5
Enter your guess: Enter your guess: 
You entered: 7You entered: 7
Welcome to my number guessing gameWelcome to my number guessing game

Enter your guess: Enter your guess: 
You entered: 4You entered: 4
Enter your guess: Enter your guess: 
You entered: 2You entered: 2
Enter your guess:    |You found it in 2 guess(es).
You entered: 8   <
Enter your guess:    <
You entered: 3   <
Welcome to my number guessing gameWelcome to my number guessing game

Enter your guess: Enter your guess: 
You entered: 9You entered: 9
Enter your guess: Enter your guess: 
You entered: 8You entered: 8
Enter your guess: Enter your guess: 
You entered: 5You entered: 5
Enter your guess: Enter your guess: 
You entered: 8You entered: 8
Welcome to my number guessing gameWelcome to my number guessing game

Enter your guess: Enter your guess: 
You entered: 4You entered: 4
Enter your guess: Enter your guess: 
You entered: 3You entered: 3
Enter your guess: Enter your guess: 
You entered: 7You entered: 7
Enter your guess: Enter your guess: 
You entered: 10You entered: 10
Welcome to my number guessing gameWelcome to my number guessing game

Enter your guess: Enter your guess: 
You entered: 4You entered: 4
Enter your guess: Enter your guess: 
You entered: 6You entered: 6
Enter your guess: Enter your guess: 
You entered: 7You entered: 7
Enter your guess: Enter your guess: 
You entered: 4You entered: 4
Welcome to my number guessing gameWelcome to my number guessing game

Enter your guess: Enter your guess: 
You entered: 4You entered: 4
Enter your guess: Enter your guess: 
You entered: 10You entered: 10
Enter your guess: Enter your guess: 
You entered: 6You entered: 6
Enter your guess: Enter your guess: 
You entered: 1You entered: 1
Welcome to my number guessing gameWelcome to my number guessing game

Enter your guess: Enter your guess: 
You entered: 6You entered: 6
Enter your guess:    |You found it in 1 guess(es).
You entered: 7   <
Enter your guess:    <
You entered: 10   <
Enter your guess:    <
You entered: 1   <
Welcome to my number guessing gameWelcome to my number guessing game

Enter your guess: Enter your guess: 
You entered: 5You entered: 5
Enter your guess: Enter your guess: 
You entered: 5You entered: 5
Enter your guess: Enter your guess: 
You entered: 3You entered: 3
Enter your guess: Enter your guess: 
You entered: 7You entered: 7
You cannot proceed in your quest until you clear this roadblock.

r/cs2a • • Oct 14 '24

Foothill Week 3 Reflection - Francisco Plans

0 Upvotes

Hello everyone!

I hope the quarter is going nicely for everyone, but as expected I found a majority of the week 3 quest to be easy, except the limerick quest which I had a little slip up understanding the poem. As for quest 4 I am on my way to finish it, and think there are lots of helpful website as I suggested before learncpp.com is my biggest tool currently, and I thoroughly enjoy the fact we have sudo code to build from in order to finish our quests.

For this week I joined the zoom for a short moment, but unfortunately had to leave due to a family event but I enjoyed seeing my classmate's share ideas, and thoughtful banter.


r/cs2a • • Mar 03 '25

Blue Reflections Week 8 - Reflection

0 Upvotes

This week I experimented with a sorting array of numbers, learning that the process begins by comparing elements and reording them based on intuition. A basic approach to this would involve trying to find the smallest or largest element and either moving it to the front or swapping elements that are adjacent if the order is wrong. Using this approach cancause a sorting method that isn't efficient with unecessary comparisons. When comparing this implementation, the similarities and differences become more clearer to see. The bubble sort algorithm follows an approach where in each pass, the adjacent elements are compared + swapped when necessary. Bubble sorting isn't efficient for larger arrays unfortunately, because it has the time complexity of O(n^2). The experimental sorting isn't as efficient either because it's not as systematic, which leads to iterations or operations. Experimenting with sorting gives us insight on the algorithmic structure and optimization, which highlights how ideas evolve in efficient ways.


r/cs2a • • Nov 03 '24

Buildin Blocks (Concepts) DFS in c++ Spoiler

0 Upvotes

I change the formatting of the code, didn't realize it was absolutely awful as a code block:

Here’s a simple example of Depth-First Search (DFS) in C++ using recursion:

include <iostream>

include <vector>

using namespace std;

void dfs(int node, vector<bool>& visited, const vector<vector<int>>& graph) { visited[node] = true; // Mark the node as visited cout << "Visited node " << node << endl;

for (int neighbor : graph[node]) { // Explore each neighbor
if (!visited[neighbor]) { // If the neighbor hasn’t been visited
dfs(neighbor, visited, graph); // Recursively visit the neighbor
}
}

}

int main() { int n = 5; // Number of nodes vector<vector<int>> graph = { {1, 2}, // Neighbors of node 0 {0, 3, 4}, // Neighbors of node 1 {0}, // Neighbors of node 2 {1}, // Neighbors of node 3 {1} // Neighbors of node 4 };

vector<bool> visited(n, false); // Track visited nodes
dfs(0, visited, graph); // Start DFS from node 0

return 0;

}

Explanation I made this based on my experience in my algorithms class, and doing DFS and A* in a Java based course. Thought I’d share for anyone interested in pathfinding. A* is really cool, you should check it out.

This code performs a Depth-First Search on a graph represented by an adjacency list (graph). Starting from a node, it marks it as visited, prints it, and then goes to each unvisited neighbor recursively. It explores as deep as possible down each path before backtracking. It starts the DFS from node 0, and the visited vector keeps track of which nodes have already been visited to avoid revisiting them.


r/cs2a • • Nov 11 '24

Blue Reflections Week 7 Reflection - Shrihan T

0 Upvotes

This week I learnt a lot more about specific functions of vectors such as the resize functions and how to initialize them with specific values. I also learnt about controlled randomness and the difference between srand() and rand() Both of them are used to make random values but the rand() function can be used to make "fake" random values by controlling the seed. The srand function is a random number function that gets a random number using a random non controlled seed. The way some random number algs work is using a seed and doing a bunch of random math to it to make it a "random" number but it is actually a "pseudo-random" number. The only way to actually get a random number is to close your eyes and just do something random but even that might involve some human biases!


r/cs2a • • Dec 04 '20

After Quest 9... After the final...

0 Upvotes

I see some of you talking about this. Cool.

In addition to all the suggestions various peeps are giving, if you have a musical side to you, consider also this (and get that $100):


r/cs2a • • Jul 31 '20

platypus More resources for Linked Lists/Quest 9!

0 Upvotes

I found these slides to be pretty helpful for understanding this. The section on linked lists starts on slide 20 :)

https://drive.google.com/file/d/1DcVeKg8Rxwn90d_MyjlnXjkJa4NXQ3Eq/view

-Nikki


r/cs2a • • Dec 11 '20

Tips n Trix (Pointers to Pointers) Another Tip for the Final Exam (Data Types)

0 Upvotes

Hey guys, for those of you who haven't completed the final exam yet, I have one tip. Make sure you know your data types well (ints, strings, chars, all that jazz). Know what they are, how they work and what they hold. It will do you well.

-Steven


r/cs2a • • Jan 26 '21

zebra Help on Fibonacci mini quest

0 Upvotes

I'm looking for a hint on the Fibonacci mini quest. I got the for loop implemented for the assignment, but don't quite get how the equation is supposed to work. If anyone can give me a hint on this one, that would be great.


r/cs2a • • Oct 16 '20

General Questing Style and Point Loss

0 Upvotes

Hello all,

I've been working through my quests and getting them correct but in the modules, & includes a few sections about style and point loss.

I was wondering if these point losses apply to the quests (so, even if we got the project correct, we can still get point loss for certain style rules when he looks over them) or for exams? I'm not sure when these style rules would apply.

Thanks!

-Nhi


r/cs2a • • Nov 23 '21

Foothill code from class on 11/23

1 Upvotes

r/cs2a • • May 10 '20

General Questing Please take a break from questing

0 Upvotes

Folks, while I investigate some issues, please take a break from questing.

Consider the freeze date extended to tomorrow (Monday noon).

Thanks for your understanding and patience.

&


r/cs2a • • Mar 24 '25

Blue Reflections Week 11 Reflection - Aiden Lee

0 Upvotes

This week was mostly spent catching up on work I missed while I had pneumonia, and studying for my finals. I coded in class for participation, and rewatched a bunch of the past lectures to help review. Currently, I have found that I'm a little shaky on classes and a few specific things like usleep and "/r". Next week, I'm planning on redoing all of the quests I didn't get full points for and continuing to study for my finals.


r/cs2a • • Jun 09 '25

Blue Reflections Week 9 Reflection - Emily P

1 Upvotes

This week I worked on and completed the elephant quest. Because I was working on this quest, I mainly learned about stacks this week. You use stacks when you need to store elements of your code in a container. You can use several different functions or operations to manipulate the elements in the stack, such as removing, adding, or fetching. I also learned how there are different types of stacks that can represent what the stack can include inside of it.


r/cs2a • • May 19 '25

Blue Reflections Week 6 reflection

1 Upvotes

This week, I focused on catching up on past assignments and am now almost up to date with the class. This was really helpful for studying for the midterm and reviewing all the topics it covered. Additionally, thanks to my previous experience with coding, I felt more comfortable learning a new programming language. Compared to other programming languages, learning C++ really helped me understand the fundamentals of how computer software works.


r/cs2a • • May 05 '25

Blue Reflections wekk 4 reflections - Douglas Dunning

1 Upvotes

Hello world,

This week we were asked to learn about:

Looping (while, for and do..while)

The difference between ++n and n++ (and likewise for the decrementing operators)

Native C++ Arrays and STL Vectors

 

Looping (while, for and do..while):

A loop repeats a block of code until a predefined condition is met, "looping" through it,
for example ( in pseudo code)

Start Loop{
display "hello world"
}

Would loop though displaying hello world until a manual break (like hitting ctrl-c or shutting off the power) , since we didn't give it any exit conditions.

for, while and do..while help us define the exit conditions.

for loops are used when you know (or can calculate) how many times you need to cycle through the loop.

for (int i = 0; i < 5; i++) {
display "hello world";
}

would perform

Start with i = 0
Check if i is less than 5
If yes:
Display "hello world"
Increase i by 1
Go back and check again
If no:
Exit the loop

While loops are for when you don't know how many times you need to run the loop, but will run while a condition is true. (note most references I found seem to use “while i < x” as their example, but I find that to be just a cumbersome way to write a “for” loop, while loops are best for conditions external to the loop,)

Ask the player if they want to play
While the player says "yes":
Start the game
Ask if they want to play again

This would repeat until the player said “no” (or anything but “yes”) but would never run the game without the player saying yes the first time.

The do...while loop guarantees at least one run because it checks the condition after the loop body

Do the following:
Start the game
Ask the player if they want to play again
While the player says "yes"

This would run the game at least once, even if the player didn’t want it to.

Difference between For, While and Do-While Loop in Programming | GeeksforGeeks

The difference between ++n and n++

n++ is post increment (or decrement for n--) and ++n is pre-increment (or decrement for --n). In short, use n++ or n-- when you want to act on the current value of n before changing it and ++n or --n if you want to change it before acting on it.

for (int i = 0; i++ < 1;) {
display "hello world";
}

would compare 0 < 1,  and since that’s true, it would display “hello world” and then on the next loop it would compare 1 < 1, which is false, and exit.

but

for (int i = 0; ++i < 1;) {
display "hello world";
}

would increment i to 1 before the first comparison, then compare 1 < 1  as false and exit without ever displaying hello world.

Difference between n++ and ++n? - DEV Community

Native C++ Arrays and STL Vectors

A native c++ array is used to store a collection of values of the same type, the size is specified when it’s declared and can’t be changed.

char vowels[5] = {'a', 'e', 'i', 'o', 'u'};

Is an array of characters, 5 characters long, you can change it to

{'a', 'b', 'c', 'd', 'e'};  (char to different char is okay)

but not to

{1, 2, 3, 4, 5};  (char to int is not okay)

or

{'a', 'e', 'i', 'o', 'u', ‘y’}; (adding elements is not okay)

Under the hood, the computer notes the array by index to the first element and uses the size of the array to figure out where it ends, the size can’t change because it’s a fixed location in the memory space.

A vector is also a sequence of objects that can be accessed by index. Unlike a native array, the vector points to the memory space of the vector object, which manages its own memory. The vector can dynamically grow and shrink, and while its data is kept in contiguous memory, it will automatically copy and reallocate memory as needed.

If you’re familiar with how c handles strings vs how c++ handles strings, a c++ array is still like a c array (a string in c is just an array of chars) and a c++ vector is like a c++ string, but for data types not limited to characters.

C++ for Programmers: C++'s Built-In Data Structures Cheatsheet | Codecademy

When I did starlings, I used a lot of repetitive or nested if statements, looking at it now, I think I can redo most of them with arrays and loops, something to consider after I finish the blue quests .


r/cs2a • • May 05 '25

Blue Reflections Week 4 reflection, Douglas Dunning

1 Upvotes

Hello world,

This week we were asked to learn about:

Looping (while, for and do..while)

The difference between ++n and n++ (and likewise for the decrementing operators)

Native C++ Arrays and STL Vectors

 

Looping (while, for and do..while):

A loop repeats a block of code until a predefined condition is met, "looping" through it,
for example ( in pseudo code)

Start Loop{
display "hello world"
}

Would loop though displaying hello world until a manual break (like hitting ctrl-c or shutting off the power) , since we didn't give it any exit conditions.

for, while and do..while help us define the exit conditions.

for loops are used when you know (or can calculate) how many times you need to cycle through the loop.

for (int i = 0; i < 5; i++) {
display "hello world";
}

would perform

Start with i = 0
Check if i is less than 5
If yes:
Display "hello world"
Increase i by 1
Go back and check again
If no:
Exit the loop

While loops are for when you don't know how many times you need to run the loop, but will run while a condition is true. (note most references I found seem to use “while i < x” as their example, but I find that to be just a cumbersome way to write a “for” loop, while loops are best for conditions external to the loop,)

Ask the player if they want to play
While the player says "yes":
Start the game
Ask if they want to play again

This would repeat until the player said “no” (or anything but “yes”) but would never run the game without the player saying yes the first time.

The do...while loop guarantees at least one run because it checks the condition after the loop body

Do the following:
Start the game
Ask the player if they want to play again
While the player says "yes"

This would run the game at least once, even if the player didn’t want it to.

Difference between For, While and Do-While Loop in Programming | GeeksforGeeks

The difference between ++n and n++

n++ is post increment (or decrement for n--) and ++n is pre-increment (or decrement for --n). In short, use n++ or n-- when you want to act on the current value of n before changing it and ++n or --n if you want to change it before acting on it.

for (int i = 0; i++ < 1;) {
display "hello world";
}

would compare 0 < 1,  and since that’s true, it would display “hello world” and then on the next loop it would compare 1 < 1, which is false, and exit.

but

for (int i = 0; ++i < 1;) {
display "hello world";
}

would increment i to 1 before the first comparison, then compare 1 < 1  as false and exit without ever displaying hello world.

Difference between n++ and ++n? - DEV Community

Native C++ Arrays and STL Vectors

A native c++ array is used to store a collection of values of the same type, the size is specified when it’s declared and can’t be changed.

char vowels[5] = {'a', 'e', 'i', 'o', 'u'};

Is an array of characters, 5 characters long, you can change it to

{'a', 'b', 'c', 'd', 'e'};  (char to different char is okay)

but not to

{1, 2, 3, 4, 5};  (char to int is not okay)

or

{'a', 'e', 'i', 'o', 'u', ‘y’}; (adding elements is not okay)

Under the hood, the computer notes the array by index to the first element and uses the size of the array to figure out where it ends, the size can’t change because it’s a fixed location in the memory space.

A vector is also a sequence of objects that can be accessed by index. Unlike a native array, the vector points to the memory space of the vector object, which manages its own memory. The vector can dynamically grow and shrink, and while its data is kept in contiguous memory, it will automatically copy and reallocate memory as needed.

If you’re familiar with how c handles strings vs how c++ handles strings, a c++ array is still like a c array (a string in c is just an array of chars) and a c++ vector is like a c++ string, but for data types not limited to characters.

C++ for Programmers: C++'s Built-In Data Structures Cheatsheet | Codecademy

When I did starlings, I used a lot of repetitive or nested if statements, looking at it now, I think I can redo most of them with arrays and loops, something to consider after I finish the blue quests and want to try for blue DAWG.