Sha256: c6f9559cc0288cbf3a892cb9069333927fd9945f469e977dca8dce2a43618373

Contents?: true

Size: 301 Bytes

Versions: 207

Compression:

Stored size: 301 Bytes

Contents

import strutils

proc convert*(sound: int): string =
  var raindrops = ""

  if (sound mod 3) == 0:
    raindrops.add("Pling")

  if (sound mod 5) == 0:
    raindrops.add("Plang")

  if (sound mod 7) == 0:
    raindrops.add("Plong")

  if len(raindrops) > 0:
    raindrops
  else:
    intToStr(sound)

Version data entries

207 entries across 207 versions & 1 rubygems

Version Path
trackler-2.2.1.119 tracks/nim/exercises/raindrops/example.nim
trackler-2.2.1.118 tracks/nim/exercises/raindrops/example.nim
trackler-2.2.1.117 tracks/nim/exercises/raindrops/example.nim
trackler-2.2.1.116 tracks/nim/exercises/raindrops/example.nim
trackler-2.2.1.115 tracks/nim/exercises/raindrops/example.nim
trackler-2.2.1.114 tracks/nim/exercises/raindrops/example.nim
trackler-2.2.1.113 tracks/nim/exercises/raindrops/example.nim
trackler-2.2.1.111 tracks/nim/exercises/raindrops/example.nim
trackler-2.2.1.110 tracks/nim/exercises/raindrops/example.nim
trackler-2.2.1.109 tracks/nim/exercises/raindrops/example.nim
trackler-2.2.1.108 tracks/nim/exercises/raindrops/example.nim
trackler-2.2.1.107 tracks/nim/exercises/raindrops/example.nim
trackler-2.2.1.106 tracks/nim/exercises/raindrops/example.nim
trackler-2.2.1.105 tracks/nim/exercises/raindrops/example.nim
trackler-2.2.1.104 tracks/nim/exercises/raindrops/example.nim
trackler-2.2.1.103 tracks/nim/exercises/raindrops/example.nim
trackler-2.2.1.102 tracks/nim/exercises/raindrops/example.nim
trackler-2.2.1.101 tracks/nim/exercises/raindrops/example.nim
trackler-2.2.1.100 tracks/nim/exercises/raindrops/example.nim
trackler-2.2.1.99 tracks/nim/exercises/raindrops/example.nim