All pastes #512494 Raw Edit

Miscellany

public cpp v1 · immutable
#512494 ·published 2007-05-26 22:10 UTC
rendered paste body
//Copyright Greg Austin 2007#include <iostream>#include <time.h>using namespace std;char key;int main(){	int cube();	int info();	int help();	char index;	cout << "welcome to GSCRAM Rubik's Cube Scrambler\npress h for help, i for info or s for cube scrambler\n";	cin >> index;	switch(index)	{		case 'h': help();		case 'i': info();		case 's': cube();	}}int cube(){	int cubes, m, e, movex, scramx, size;	char mainm[] = "rlfbudRLFBUD";	char maine[] = " '";	cout << "what size cube would you like to scramble?" << "\n";	cin >> cubes;	switch(cubes)	{		case 2: size = 6; break;		case 3: size = 6; break;		case 4: size = 12; break;		case 5: size = 12; break;	}	cout << "how many scrambles do you want?" << "\n";	cin >> scramx;	cout << "how many moves do you want per scramble?" << "\n";	cin >> movex;	srand((unsigned) time(0));	for(int y =1; y <= scramx; y++)	{		cout << "Scramble " << y << ": ";		for(int x = 1; x <= movex; x++)		{				m = rand() % size;			e = rand() % 2;			cout << mainm[m] << maine[e] << " ";		}		cout << "\n\n";	}		cout << "Please Press any key to continue" << endl;	cin >> key;	return 0;}int help(){return 0;}int info(){	int main();	cout << "GSCRAM was built by Greg Austin to assist with cube scrambling\n";	cout << "GSCRAM supports cube sizes from 2x2x2 to 5x5x5 and multiple scrambles\n\nPress any key to return to main menu";	cin >> key;	return 0;	main();}