This is the companion repo for my book C# with Miyoshi. (This whole repo is still a work in progress. The book is not yet available on Amazon, so the links to the book do not work yet. There are things that need updating. And I have a few references to C++, that are there until I get the C# ones done. But I needed to get it going because school starts soon and I need to have it ready to go even if it is not completely ready to go.)
I provide my book, C# with Miyoshi, to the students in my class, but to those who are not in my class, the book is available online at either of the above links. (I suppose you could call this an ad.)
This repo will change and grow in time with feedback from my students and other readers.
At first, it will have a few Visual Studio projects that people can clone. It will then include programming problems and projects and something I like to call competency tests. I have a repo with all the example code that is in the book and one with more example code that I think of as I go along. Who knows where it will go from there?
I have added a new repo starting the 2024-2025 school year that is meant to be programming prompts that the students complete. This new repo is called CompleteTheCode. It is not complete, but by the end of the school year, I hope to have starts to pieces of code that will get the students to write their own code. Code for outputting stuff to the screen, moving text, doing math, creating and using random numbers, branching, looping, and hopefully everything else I cover in my introductory class.
I am using Visual Studio Community 2022. The nice thing about that Integrated Development Environment (IDE) is that you can just do the cloning/forking when you are running the IDE. When you open the VS 2022, you will see the clone option right there. Some people have lamented the demise of the old start screen, but if you are cloning projects from repositories, you will probably like it. It is the first choice.
If you are not using Visual Studio, you can still benefit from the repos. Just create your projects (and/or repos) in your IDE of choice. Then, grab the .cpp files from my repos. This will work with all of my repos except the Game Engine Tutorial. You will need to create an SFML project and probably a bunch more work. Or you can just use Visual Studio for that project. After all, the community edition is free.
It might seem overwhelming if you are learning to program and then you get sent to GitHub to "clone a repo." Do not worry. A repo is essentially just a folder where you keep your stuff. But let us step back a step. Repo is short for REPOSITORY. And a repository is just a place to hold stuff. So a Git or GitHub repo just holds your stuff in a certain way. (See more at GitHub: About Repositories page.)
Git is an open source control system. You use it on your local computer and you can also use it to interface with online storage and collaboration spaces like GitHub. You will need an account if you want to store your own repos on GitHub, but you can clone repos without one. You can either make GitHub repos public or private. Private means that only you and anybody you invite to collaborate with you can see your repo(s). Public is just that, public. Anybody can see your repo and all that is in it.
So what is cloning? Cloning is taking somebody else's public (or private) repo and copying it for your own use on your local computer. You might just want to see what it does or you might want to change it or you might want to contribute to some project. Usually, you start by cloning the repo (and thus the project). If you want to contribute to somebody's project, you will need to fork the repo. Even if you do not want to contribute to somebody else's project, you will fork a repo if you want to keep your own copy of it on GitHub. Only clone a repo if you are only going to keep it on your local computer. Which does seems a bit of a waste.
Forking and Cloning and Repos. Oh my!
Do not worry. There are lots of resources to help you on your way. For instance: Forking vs. Cloning and all the links in this section and lots more.
(If you have not cloned or forked a repo yet, open the CloneRepo.md file for directions (with pictures) on how to do it.)
Variables and Constants (First repo to clone or fork)
If you are reading my book, you will want to clone your first Visual Studio project. It is similar to the variables and constants file found in the book, but slightly different. It is a great jumping off point for not only the Variables and Constants problem (GS01-05), but can be used as a starting point for any of the projects. My students are required to have the large comment block in the beginning of the code, but if you are not in my class, do not feel obligated to comment your code like I have my students do. (Just remember though. Someday you will have somebody telling you how to document your code if you become a professional coder.)
This repo is an example of the RPG project given in the book. As I note in the README file of the repo, look at the branches in chronological order, especially if you are just starting to code in C++. By the way, it is a very tiny RPG. If you can even call it an RPG.
The game engine tutorial is an SFML project, and is a precursor to the culminating project I have in my class. The tutorial and initial project were written by Eric Williams. The C# version was updated from the Visual Studio 2019 version of the project which were both updated (from the 2015 version) by Mike Magruder.
By the way, here is the cover of my book. (It is a link that I suppose could be considered an ad.)
