Difference between revisions of "Intermediate C++ Game Programming Tutorial 7"

From Chilipedia
Jump to: navigation, search
(Video Timestamp Index)
(Homework)
 
(11 intermediate revisions by the same user not shown)
Line 2: Line 2:
  
 
== Topics Covered ==
 
== Topics Covered ==
* C++ Steams
+
* C++ Streams
* std::cin / std::cout
+
* <code>std::cin</code> / <code>std::cout</code>
* Insertion / extraction operators
+
* Insertion <code><<</code> / extraction <code>>></code> operators
 
* <code>std::endl</code> and buffered I/O flushing
 
* <code>std::endl</code> and buffered I/O flushing
 
* <code>&lt;iomanip&gt;</code>
 
* <code>&lt;iomanip&gt;</code>
* Cleaning out an input stream
+
* Cleaning an input stream with <code>ignore()</code> and <code>clear()</code>
 
* <code>std::numeric_limits<></code>
 
* <code>std::numeric_limits<></code>
 
* <code>std::string</code>
 
* <code>std::string</code>
* <code>OutputDebugString</code>
+
* <code>OutputDebugString()</code>
 
* <code>std::stringstream</code>
 
* <code>std::stringstream</code>
 
  
 
== Video Timestamp Index ==
 
== Video Timestamp Index ==
[https://youtu.be/OwDJGrV Tutorial 7]
+
[https://youtu.be/EIzkeFTpMq0 Tutorial 7]
  
 
== Source Code ==
 
== Source Code ==
Line 21: Line 20:
  
 
== Other Links ==
 
== Other Links ==
[https://www.cppreference.com C++ Hardcore Reference]
+
[https://www.cppreference.com C++ Hardcore Reference]<br />
[https://www.cplusplus.com C++ Softcore Reference]
+
[http://www.cplusplus.com C++ Softcore Reference]<br />
 
[http://www.gutenberg.org/files/2600/2600-0.txt War and Peace (warp.txt)]
 
[http://www.gutenberg.org/files/2600/2600-0.txt War and Peace (warp.txt)]
  
 
== Homework ==
 
== Homework ==
The homework is to create a stack container that is implemented with with a linked list data structure. The skeleton of the interface for the Stack class is given in the source code (see the Downloads above). These are the minimum functions that must be implemented. For further information on stacks, see [https://youtu.be/Cjx5C2I3UrA?t=9m53s this video]. For further information on linked lists, see [https://youtu.be/j1ZF__Ml5ds?t=20m10s this video]. Furthermore, additional research is highly recommended.
+
The homework is to modify Poison Snek so that various game settings can be configured by the user by editing a text file. The settings file should be parseable regardless of the order of the settings in the file. The following settings are recommended:
 
+
The behaviors of the interface functions are for the student to infer, with the exception of the Pop() function. In the case of calling Pop() on an empty stack, the function shall return -1. The internal implementation details are also to be determined by the student, but they must at their core use a linked list data structure.
+
  
When the Stack is fully implemented and the program is executed, there are 8 test routines that will be run. All test routines should output 'Passed' to the console for the homework to be considered solved. Furthermore, the heap memory will be monitored at the end of the program and any dynamic memory that has not been freed will trigger a diagnostic error message. It is required that no diagnostic error be output for the homework to be considered solved.
+
* Tile Size
 +
* Board Size
 +
* Speedup Rate
 +
* Poison Amount
 +
* Food Amount
  
The string routines developed during Intermediate are available for use (but are not strictly necessary). The student may not modify any of the test code. The student may not use any additional classes/functions from the standard library or any 3rd party library. If necessary, it is recommended that the Stack class be developed in a separate solution and tested with custom testing code and diagnostic outputs. Then when the Stack class is deemed ready, it can be transplanted into the test solution for final validation.
+
For this homework, you are not required to handle malformed input files, though you can attempt to handle those as a bonus challenge if you like.
  
 
== See also ==
 
== See also ==
 
* [[Intermediate C++ Game Programming Tutorial 8|Next in series (Tutorial 8)]]
 
* [[Intermediate C++ Game Programming Tutorial 8|Next in series (Tutorial 8)]]
 
* [[Intermediate C++ Game Programming Series]]
 
* [[Intermediate C++ Game Programming Series]]

Latest revision as of 17:35, 30 July 2017

We finally ditch our janky makeshift chili:: routines and use some real shit here. Standard streams (std::cin / std::cout / std::fstream) are covered, and then we talk about string manipulation with std::string. We'll also cover some other less well-known dank C++ code memes, so check it out. Note that this video is more of an overview / whirlwind tour; it introduces various techniques and gives examples, but don't expect a detailed or exhaustive treatment here.

Topics Covered

  • C++ Streams
  • std::cin / std::cout
  • Insertion << / extraction >> operators
  • std::endl and buffered I/O flushing
  • <iomanip>
  • Cleaning an input stream with ignore() and clear()
  • std::numeric_limits<>
  • std::string
  • OutputDebugString()
  • std::stringstream

Video Timestamp Index

Tutorial 7

Source Code

GitHub Repo for Snek

Other Links

C++ Hardcore Reference
C++ Softcore Reference
War and Peace (warp.txt)

Homework

The homework is to modify Poison Snek so that various game settings can be configured by the user by editing a text file. The settings file should be parseable regardless of the order of the settings in the file. The following settings are recommended:

  • Tile Size
  • Board Size
  • Speedup Rate
  • Poison Amount
  • Food Amount

For this homework, you are not required to handle malformed input files, though you can attempt to handle those as a bonus challenge if you like.

See also