Read em and weep

I did it. I made a almost fully functional minesweeper program that is played in the CLI in C. My first step into learning. Whats next for me bros? I feel a bright future ahead of me. I got a pretty nice feeling of accomplishment seeing it all finally come together. Its only missing an option to flag but it doesn't really bother me because i can just flag tiles in my head, its just unnecessary bloat.

github.com/Caneaus/First_Code_Minesweeper

Tell me what i should create/study next on my journey, give me an assignment.

Attached: Remellia_Scarlettt12312312.jpg (1500x2300, 580.61K)

>Whats next for me bros?
abandoning C and learning a language people actually use for anything real

nakadashi

Attached: 1658410995640.jpg (756x1280, 165.15K)

I lol'd hard at the descriptions of mines to various sides in MinesweeperNewb.cpp

Vamp pussy.

>//printf("Ack!
lel

I like doing print commands to debug every step because there was something fucked. it also adds to the game experience if i could incorporate it

You can just use a debugger if you're going to use Visual Studio anyway

no idea how to use it. Often the program runs "cleanly" but it doesn't work as intended and the errors dont help me there

cunny nakadashi supreme vamyre

Nice! Keep up the good work! I'm not a C expert, but you can probably choose not to include .exe and some other files like .pdb, .log etc.in your source code to reduce the size.

Attached: 1649218117155.jpg (906x574, 411.99K)

>int cunnycunnycunny = 0;
What is this used for?

> int cunnycunnycunny = 0;
kek. I KNEEL.

what made you decide to make this post into its own thread instead of a reply in /dpt/?
im just asking questiobs

everyone there seems to be on a higher level sharing actual shit, i wanted actual review and specific reccs on what to do next.
not to mention generals are cancer.
It was originally gonna be a counter like I. But i discovered instead of doing a counter for the whole array to cascade the detection i could put the function inside of itself.

declare all your variables at the start lf the function scope
write less and shorter comments, and longer more explicit variable names

Thanks for the tip! a lot of the comments were for myself so i actually knew what i was trying ot do, also got the "goal" of each section into my head. The variables felt wonky to me, sometimes if i declared them in the beginning if i used them in a functtion later it wouldnt work unless i redeclared in the function

how is she so cute bros?

I don't know

Attached: 1650567322594.jpg (2185x1553, 1.59M)

Good. Now Learn how to write unit tests in C, then write enough so most of your code will be test coverage so you will be confident to change it without breaking something.
Learn what is cyclomatic complexity and redactor it. There is too much nested loops you can replace them by writing small functions

So, im looking at some guides on unit testing (Its in c# but i think i understand the logic), and they used an example like this:

int dosomething(int x){
foo = x *2;
return foo;
}

and the test will be something like
bool dosomething_should_give_x_times_2 (){
if ( foo/2 = x) {
return 1;
}
else{
return 0
}
}

I fail to see how this is any different from just compiling and running the code and reading the result. Obviously this is a very mundane example but could you give one that makes more sense?

Def dosomething(x) { x *2 }

Assertthat do something(2) == 4
Assert that do something(5) == 10

Makes more sense for bigger methods. Also for more complex programs than CLI where there is lot of clicking to check if something still works, but can be easily automated with unittesting.
But think about it like that you have method that takes coordinate x y and checks if there is bomb there if it is show result or something. So in unit test you can set up own board where you know in x y there is a bomb, and then you call this method and in test you assert that result "you failed" was printed or something. Not only you click one button to run test and check it still work, you don't need to play entire game from beginning to end to see this one small part still works. Also no matter how much you change content of this function as long as input and output in unit test are same you know it still works