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.159 tracks/coffeescript/exercises/hexadecimal/example.coffee
trackler-2.2.1.158 tracks/coffeescript/exercises/hexadecimal/example.coffee
trackler-2.2.1.157 tracks/coffeescript/exercises/hexadecimal/example.coffee
trackler-2.2.1.156 tracks/coffeescript/exercises/hexadecimal/example.coffee
trackler-2.2.1.155 tracks/coffeescript/exercises/hexadecimal/example.coffee
trackler-2.2.1.154 tracks/coffeescript/exercises/hexadecimal/example.coffee
trackler-2.2.1.153 tracks/coffeescript/exercises/hexadecimal/example.coffee
trackler-2.2.1.152 tracks/coffeescript/exercises/hexadecimal/example.coffee
trackler-2.2.1.151 tracks/coffeescript/exercises/hexadecimal/example.coffee
trackler-2.2.1.150 tracks/coffeescript/exercises/hexadecimal/example.coffee
trackler-2.2.1.149 tracks/coffeescript/exercises/hexadecimal/example.coffee
trackler-2.2.1.148 tracks/coffeescript/exercises/hexadecimal/example.coffee
trackler-2.2.1.147 tracks/coffeescript/exercises/hexadecimal/example.coffee
trackler-2.2.1.146 tracks/coffeescript/exercises/hexadecimal/example.coffee
trackler-2.2.1.145 tracks/coffeescript/exercises/hexadecimal/example.coffee
trackler-2.2.1.144 tracks/coffeescript/exercises/hexadecimal/example.coffee
trackler-2.2.1.143 tracks/coffeescript/exercises/hexadecimal/example.coffee
trackler-2.2.1.142 tracks/coffeescript/exercises/hexadecimal/example.coffee
trackler-2.2.1.141 tracks/coffeescript/exercises/hexadecimal/example.coffee
trackler-2.2.1.140 tracks/coffeescript/exercises/hexadecimal/example.coffee