Sha256: 3116dafb92ee439b0de1255ebc3cd848650d39abc886025790731913c98debfd

Contents?: true

Size: 1.34 KB

Versions: 396

Compression:

Stored size: 1.34 KB

Contents

#lang racket/base

;; Converts integers to English-language descriptions

;; --- NOTE -------------------------------------------------------------------
;; The test cases in "say-test.rkt" assume:
;; - Calling a function with an out-of-range argument triggers a contract error
;; - That `step3` returns a list of (number, symbol) pairs
;;
;; We have provided sample contracts so the tests compile, but you
;;  will want to edit & strengthen these.
;;
;; (For example, things like 0.333 and 7/8 pass the `number?` contract
;;  but these functions expect integers and natural numbers)
;; ----------------------------------------------------------------------------

(require racket/contract)

(provide (contract-out
  [step1 (-> number? string?)]
  ;; Convert a positive, 2-digit number to an English string

  [step2 (-> number? (listof number?))]
  ;; Divide a large positive number into a list of 3-digit (or smaller) chunks

  [step3 (-> number? (listof (cons/c number? symbol?)))]
  ;; Break a number into chunks and insert scales between the chunks

  [step4 (-> number? string?)]
  ;; Convert a number to an English-language string
))

;; =============================================================================

(define (step1 n)
  "step1: not implemented")

(define (step2 N)
  '())

(define (step3 n)
  '())

(define (step4 N)
  "step4: not implemented")

Version data entries

396 entries across 396 versions & 1 rubygems

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