Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <string>
- #include <iostream>
- #include <sstream>
- #include <vector>
- #include <list>
- #include <map>
- #include <cmath>
- #include <cstdio>
- #include <algorithm>
- #include <unistd.h>
- #include "sys/types.h"
- #include "sys/sysinfo.h"
- #include <time.h>
- #include <stdlib.h>
- using namespace std;
- class Point {
- unsigned int x_, y_;
- public:
- Point(int x = 0, int y = 0) : x_(x), y_(y) {}
- bool operator==(const Point& other){
- return ((x_ == other.x_) && (y_ == other.y_));
- }
- int getX() const {
- return x_;
- }
- int getY() const {
- return y_;
- }
- void setX(int x) {
- x_ = x;
- }
- void setY(int y) {
- y_ = y;
- }
- };
- int main(){
- // PI6I SEED TUKA
- int seed = 87654;
- srand(seed);
- //I E ZA KOLKO P1TI DA VR1TNE CIKALA. DAVA NQKAV FLOATING POINT EXCEPTION? PRI MNOGO IIIIIIIIIIII
- for(int i = 0; i < 1; i++){
- int x = rand() % 20;
- int y = rand() % 20;
- cout << x << " " << y << endl;
- int bombsc = 400;
- while(bombsc>x*y||bombsc==0)
- bombsc = rand() % 20;
- cout << bombsc << endl;
- vector<Point> bombs;
- for(int k = 0; k < bombsc; k++){
- Point randomPoint(rand()%y, rand()%x);
- if(!(find(bombs.begin(), bombs.end(), randomPoint)!=bombs.end())){
- bombs.push_back(randomPoint);
- }else{
- k--;
- }
- }
- for(int k = 0; k < bombs.size(); k++)
- cout << bombs[k].getY() << "," << bombs[k].getX() << endl;
- // KOLKO OPERACII DA VR1TNE. MI MNOGO OT TVA I MNOGO OT IIIIIIIIII 6E NAPRAVI LO6I RABOTI AMA TI SI ZNAE6
- // OPTIMALNO MOJE BI E 15?
- for(int k = 0; k < 10; k++){
- int command = rand() % 15; //0 = click 1 = flag 2 = hint
- Point randomPoint(rand()%y, rand()%x);
- string butifel;
- switch(command){
- case 0: butifel = "click "; goto a;
- case 1: butifel = "click "; goto a;
- case 2: butifel = "click "; goto a;
- case 3: butifel = "click "; goto a;
- case 4: butifel = "click "; goto a;
- case 5: butifel = "click "; goto a;
- case 6: butifel = "click "; goto a;
- case 7: butifel = "click "; goto a;
- case 8: butifel = "click "; goto a;
- case 9: butifel = "click "; goto a;
- case 10: butifel = "click "; goto a;
- case 11: butifel = "click "; goto a;
- case 12: butifel = "flag "; goto a;
- case 13: butifel = "flag "; goto a;
- case 14: butifel = "hint "; goto a;
- }
- a:
- cout << butifel << randomPoint.getY() << "," << randomPoint.getX() << endl;
- }
- }
- }
- // COURTESY NA ELIZA KOLMAKOV
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement