Created
September 23, 2019 06:11
-
-
Save lbvf50mobile/013ca9295ec5e53ac4384863182238f5 to your computer and use it in GitHub Desktop.
move-hero
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
#lang racket | |
;;; https://www.codewars.com/kata/grasshopper-terminal-game-move-function/train/racket | |
(provide move-hero) | |
(define (move-hero position roll) | |
(+ position (* 2 roll))) |
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
# https://www.codewars.com/kata/grasshopper-terminal-game-move-function | |
position=$1 | |
roll=$2 | |
echo "$position + 2 * $roll" | bc |
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
--# write your statement here: you will be given a table 'moves' with columns 'position' and 'roll'. return a table with a column 'res'. #-- | |
-- https://www.codewars.com/kata/grasshopper-terminal-game-move-function/train/sql | |
select moves.position + 2 * moves.roll as res from moves; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment