This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
int main() | |
{ | |
int A[12] = { | |
1, 1, 1, 1, | |
1, 1, 1, 1, | |
1, 1, 1, 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MAXIMUM_VELOCITY = <any number>; | |
SQUARED_MAXIMUM_VELOCITY = MAXIMUM_VELOCITY * MAXIMUM_VELOCITY; | |
function animate(){ | |
var squared_horizontal_velocity = (x_velocity * x_velocity) + (z_velocity * z_velocity); | |
if( squared_horizontal_velocity > SQUARED_MAXIMUM_VELOCITY ){ | |
var velocity_magnitude = sqrt(squared_horizontal_velocity); | |
var scalar = MAXIMUM_VELOCITY / velocity_magnitude; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <cstdint> | |
#include <cassert> | |
#include <sstream> | |
#include <iomanip> | |
namespace { | |
typedef uint8_t U8; | |
typedef uint16_t U16; | |
typedef uint32_t U32; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stack> | |
#include <memory> | |
#include <cassert> | |
// Polymorphic base class for menus | |
class Menu | |
{ | |
public: | |
// Common to all menus: | |
// (for example) |