Skip to content

Instantly share code, notes, and snippets.

@tenpn tenpn/gist:1216696
Created Sep 14, 2011

Embed
What would you like to do?
shuffle
#include <algorithm>
#include <vector>
#include <stdio>
int main()
{
typedef std::pair<int,int> Pos;
typedef std::pair<Pos, unsigned char> PosChar;
typedef vector<PosChar> list;
list.push_back(PosChar(Pos(1,2),'a'));
list.push_back(PosChar(Pos(2,3),'b'));
list.push_back(PosChar(Pos(3,4),'c'));
std::random_shuffle(list.begin(), list.end());
std::out << list[0] << ", " << list[1] << ", " << list[2];
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.