/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*    http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

'use strict';

var round = require( '@stdlib/math/base/special/round' );
var randu = require( '@stdlib/random/base/randu' );
var find = require( './../lib' ); // eslint-disable-line stdlib/no-redeclare

var data;
var opts;
var vals;
var i;

// Simulate the data...
data = new Array( 100 );

for ( i = 0; i < data.length; i++ ) {
	data[ i ] = round( randu*100 );
}

// Find the first 10 values greater than 25...
opts = {
	'k': 10,
	'returns': '*'
};

function condition( val ) {
	return val > 25;
}

vals = find( data, opts, condition );
console.log( vals.join( '\n' ) );
