Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wyeliminowanie prostszych kombinacji wejścia i wyjścia issue #26 #39

Merged
merged 2 commits into from
Oct 15, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
#include <ctime> /* time */
#include <dirent.h>
#include <fstream>
#include <cmath>
#include <vector>


// code from https://gist.github.com/Nircek
// under MIT license
#include <iostream>
Expand Down Expand Up @@ -100,9 +102,16 @@ void beginingcoords() { // bierze poczontkowe koordy i wrzuca do zmiennej
player_coords = randomCoords();
}
void targetcoords() { // bierze koordy celu/wyjścia i wrzuca do zmiennej
end_coords = randomCoords();
}
int rozmiar ,rzmr,sm=SIZE,sn=SIZE ;
do{
end_coords = randomCoords();
rozmiar = sqrt(2*pow(mapa[0].size(),2))/2;
rzmr = sqrt(pow(player_coords.x-end_coords.x,2)+pow(player_coords.y-end_coords.y,2));
cout << rzmr << " "<< rozmiar << endl;
}while (rzmr<rozmiar);
}
char getEvent()

{
return getch();
}// pobierz znak
Expand Down