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 <SFML/Graphics.hpp> | |
#include <vector> | |
void pollEvent(sf::RenderWindow& window) | |
{ | |
sf::Event event; | |
while (window.pollEvent(event)) | |
{ | |
if (event.type == sf::Event::Closed) | |
window.close(); |
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
class RoundedRectangleShape : public sf::Shape | |
{ | |
public: | |
explicit RoundedRectangleShape(const sf::Vector2f& size = {}) | |
: size(size) | |
, radius(10.f) | |
, pointCount(4) | |
, totalPoints(4 * 4) | |
{ | |
update(); |
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 <SFML/Graphics.hpp> | |
#include <iostream> | |
#include <iomanip> | |
#include <unordered_map> | |
#include <unordered_set> | |
#include <array> | |
#include <vector> | |
#include <utility> | |
#include <queue> | |
#include <tuple> |
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
// ------------------------------------------------------------------------- | |
// Filename: astar.h | |
// Version: 1.24 | |
// Date: 2002/03/08 | |
// Purpose: Provide template for a* algorythm | |
// (c) T.Frogley 1999-2002 | |
// ------------------------------------------------------------------------- | |
#ifndef ASTAR_H | |
#define ASTAR_H |
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
//https://codereview.stackexchange.com/questions/133668/constexpr-sin-function-c-14 | |
#include <type_traits> | |
#include <limits> | |
#include <array> | |
#include <cmath> | |
#include <iostream> | |
template<std::size_t... Is> struct seq{}; | |
template<std::size_t N, std::size_t... Is> |
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 <vector> | |
#include <iostream> | |
#include <map> | |
#include <algorithm> | |
#include <string> | |
using namespace std; | |
const char FLOOR = '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
/******************************************************************************************* | |
* Name: Jay Seong * | |
* Description: Randomly generates a perfect maze using depth-first search algorithm * | |
* Date: 02/11/2010 * | |
* Data Structures: Double array of structs for cells, stack for back-tracking * | |
* Others: fstream is used to save maze into a file * | |
* * | |
* NOTE: Transcribed from a YouTube video https://www.youtube.com/watch?v=EvAzVhAii_o by * | |
* Stephen Pendley to distribute for public use. All credit for this version of the code * | |
* and it's original goes to Jay Seong. * |
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> | |
#include <memory> | |
#include <stack> | |
/* A binary tree node has data, pointer to left child | |
and a pointer to right child */ | |
struct Node | |
{ | |
Node(int data) : data(data), left(nullptr), right(nullptr) {} | |
int data; |
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> | |
#include<cmath> | |
#include<stdio.h> | |
#include<cstdlib> | |
#include<map> | |
#include<stack> | |
using namespace std; | |
int expression_value(string str) | |
{ |
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
//http://codereview.stackexchange.com/questions/132587/sketch-of-chutes-and-ladders-game | |
#include <iostream> | |
#include <iomanip> | |
#include <vector> | |
#include <random> | |
#include <algorithm> | |
#include <array> | |
#include <vector> | |
#include <utility> | |
#include <cmath> |