This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cfscript> | |
people = queryNew( | |
"id, firstName, lastName, email, country, ip_address", | |
"integer, varchar, varchar, varchar, varchar, varchar", | |
[{ | |
"id": 1, | |
"firstName": "Christopher", | |
"lastName": "Burton", | |
"email": "[email protected]", | |
"country": "Poland", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cfscript> | |
// A small frog wants to get to the other side of the road. | |
// The frog is currently located at position X and wants to get to a position greater than or equal to Y. | |
// The small frog always jumps a fixed distance, D. | |
// Count the minimal number of jumps that the small frog must perform to reach its target. | |
// Write a function that, given three integers X, Y and D, returns the minimal number of jumps from position X to a position equal to or greater than Y. | |
// For example, given: | |
// X = 10 | |
// Y = 85 | |
// D = 30 the function should return 3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cfscript> | |
function fibonacci(nth) { | |
fibString = "1"; | |
if (nth GT 1) { | |
prev2 = 0; | |
prev1 = 1; | |
for (i=2; i LTE nth; i=i+1) { | |
thisItem = prev2 + prev1; | |
fibString = fibstring & " " & thisItem; |