Sha256: a2f16b0b76e94aa048d5ade1aad08e213bc71084a6541301f62db8a8c38f9dc7

Contents?: true

Size: 472 Bytes

Versions: 146

Compression:

Stored size: 472 Bytes

Contents

/**
* Here is an example solution for the Raindrops exercise
*/
component {

	function convert( number ) {
		
		var response = '';
		
		// Factor of 3
		if( number % 3 == 0 ) {
			response &= 'Pling';
		}
		
		// Factor of 5
		if( number % 5 == 0 ) {
			response &= 'Plang';
		}
		
		// Factor of 7
		if( number % 7 == 0 ) {
			response &= 'Plong';
		}
		
		// Did we find any factors?
		if( response.len() ) {
			return response;
		} else {
			return number;
		}
	}
			
}

Version data entries

146 entries across 145 versions & 1 rubygems

Version Path
trackler-2.2.1.180 tracks/cfml/exercises/raindrops/Solution.cfc
trackler-2.2.1.179 tracks/cfml/exercises/raindrops/Solution.cfc
trackler-2.2.1.178 tracks/cfml/exercises/raindrops/Solution.cfc
trackler-2.2.1.177 tracks/cfml/exercises/raindrops/Solution.cfc
trackler-2.2.1.176 tracks/cfml/exercises/raindrops/Solution.cfc
trackler-2.2.1.175 tracks/cfml/exercises/raindrops/Solution.cfc
trackler-2.2.1.174 tracks/cfml/exercises/raindrops/Solution.cfc
trackler-2.2.1.173 tracks/cfml/exercises/raindrops/Solution.cfc
trackler-2.2.1.172 tracks/cfml/exercises/raindrops/Solution.cfc
trackler-2.2.1.171 tracks/cfml/exercises/raindrops/Solution.cfc
trackler-2.2.1.170 tracks/cfml/exercises/raindrops/Solution.cfc
trackler-2.2.1.169 tracks/cfml/exercises/raindrops/Solution.cfc
trackler-2.2.1.167 tracks/cfml/exercises/raindrops/Solution.cfc
trackler-2.2.1.166 tracks/cfml/exercises/raindrops/Solution.cfc
trackler-2.2.1.165 tracks/cfml/exercises/raindrops/Solution.cfc
trackler-2.2.1.164 tracks/cfml/exercises/raindrops/Solution.cfc
trackler-2.2.1.163 tracks/cfml/exercises/raindrops/Solution.cfc
trackler-2.2.1.162 tracks/cfml/exercises/raindrops/Solution.cfc
trackler-2.2.1.161 tracks/cfml/exercises/raindrops/Solution.cfc
trackler-2.2.1.160 tracks/cfml/exercises/raindrops/Solution.cfc