Sha256: 24a3890837a61e721f6cff6f758efeb3e0a2c8c772bc658b619bb4ecd0373a2d

Contents?: true

Size: 197 Bytes

Versions: 396

Compression:

Stored size: 197 Bytes

Contents

module.exports = class Hexadecimal
  constructor: (hex) ->
    @hex = hex

  toDecimal: ->
    for char in this.hex.split("")
      return 0 if /[^0-9a-fA-F]/.exec(char)

    parseInt(this.hex,16)

Version data entries

396 entries across 396 versions & 1 rubygems

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