Skip to content

Instantly share code, notes, and snippets.

#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();
class RoundedRectangleShape : public sf::Shape
{
public:
explicit RoundedRectangleShape(const sf::Vector2f& size = {})
: size(size)
, radius(10.f)
, pointCount(4)
, totalPoints(4 * 4)
{
update();
#include <SFML/Graphics.hpp>
#include <iostream>
#include <iomanip>
#include <unordered_map>
#include <unordered_set>
#include <array>
#include <vector>
#include <utility>
#include <queue>
#include <tuple>
@MORTAL2000
MORTAL2000 / astar.h
Created July 2, 2016 17:22 — forked from codemonkey-uk/astar.h
The C++ header file "astar.h" implements the A* graph search (route finding) algorithm using a C++ function template. The interface is written in an STL like style.
// -------------------------------------------------------------------------
// 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
//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>
#include <vector>
#include <iostream>
#include <map>
#include <algorithm>
#include <string>
using namespace std;
const char FLOOR = '1' ;
/*******************************************************************************************
* 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. *
#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;
#include<iostream>
#include<cmath>
#include<stdio.h>
#include<cstdlib>
#include<map>
#include<stack>
using namespace std;
int expression_value(string str)
{
//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>