lundi 9 janvier 2017

Checking for same values in two arrays

I need to make a method, which gets two arrays (same length), and their values represent the x axis and y axis coordinates of a 2d matrix. I need to check for duplicate entries of the same point (x and y are the same).

The idea of the program is: a random matrix is generated with coins represented with 1 and 0. The user imputs the size of the square matrix. then he inputs the number of points he will try to guess in the matrix that contain the value 1.

I have to check for duplicate entries of the same x and y axis (same points) so that the user cannot get points for "finding" the same coin twice or more times..i currently have all the coordinates in two separate array..if there is a better way for me to do this check it would be great :) pls help




Aucun commentaire:

Enregistrer un commentaire