 }
 
 __device__
+bool create_queen(int * tab, int x, int y){
+    int n = 8;
+    if ((x != 0 && x != n-1) ||
+        (tab[x*n+y] != WHITE && tab[x*n+y] != BLACK) ||
+        (x == 0 && tab[x*n+y] == BLACK) ||
+        (x == n-1 && tab[x*n+y] == WHITE))
+        return false;
+    if (tab[x*n+y] == WHITE)
+        tab[x*n+y] = queenW;
+    else
+        tab[x*n+y] = queenB;
+    return true;
+}
+
+__device__
 bool is_queen(int * tab, int x, int y){
 	int n = 8;
     return (tab[x*n+y] == queenB || tab[x*n+y] == queenW);

		}
		//zwroc wynik (?)
	}
    
//>>>>>>> d7adecfe7e0407bbe669ef75a06f1ba72ca587af
__device__
    void print_tr(checkers_point * ch){
        if (ch == NULL)

}

__device__
	next_kill * create_next_move(int x, int y, int * par_tb, int x1, int y1){
	next_kill * res = new next_kill;
        res->t[0] = x; res->t[1] = y;
        res->t[2] = x1; res->t[3] = y1;
	res->parent_tab = par_tb;
	return res;
}

__device__
	void copy_board(int * ch, checkers_point * ch2){
		for (int i = 0; i < 64; i++){
			ch2->board[i] = ch[i];
		}
	}

__device__
	checkers_point * again(checkers_point * ch, next_kill * first, next_kill * last, int pm){
	int x = first->t[0], y = first->t[1], x1 = first->t[2], y1 = first->t[3], * tab = first->parent_tab;
	if(is_move_correct(tab, x, y, pawn_owner(tab, x, y), x1, y1)){
		checkers_point * chld;
		ch->next = new checkers_point;
                ch->next->parent = ch->parent;
                ch->next->prev = ch;
                chld = ch->next;
		chld->min_max = !chld->parent->min_max;
		copy_board(tab, chld);
		chld->parent->how_much_children++;
		chld->board[x1*8+y1] = chld->board[x*8+y];
                chld->board[x*8+y] = EMPTY;
                chld->board[(x+x1)/2*8+(y+y1)/2] = EMPTY;
                ch = chld;
                create_queen(chld->board, x1, y1);
		last = first = create_next_move(x1, y1, ch->board, x1+pm, y1+2);
                last->next = create_next_move(x1, y1, ch->board, x1+pm, y1-2);
	}
	return ch;
}

__device__
	checkers_point * pawn(checkers_point * ch, int x, int y, int x1, int y1, bool &nxt, checkers_point * chprev, int & rand, bool iskillsomethingnow){
