Skip to content

Instantly share code, notes, and snippets.

@lbvf50mobile
Created September 23, 2019 06:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lbvf50mobile/013ca9295ec5e53ac4384863182238f5 to your computer and use it in GitHub Desktop.
Save lbvf50mobile/013ca9295ec5e53ac4384863182238f5 to your computer and use it in GitHub Desktop.
move-hero
#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)))
# https://www.codewars.com/kata/grasshopper-terminal-game-move-function
position=$1
roll=$2
echo "$position + 2 * $roll" | bc
--# 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