Versionen im Vergleich

Schlüssel

  • Diese Zeile wurde hinzugefügt.
  • Diese Zeile wurde entfernt.
  • Formatierung wurde geändert.

...

Now we need to find a way transforming the input to the flag, ie. 0 for 48..58 and 1 for 65..70. Oh look, a logarithm!

INPUTASCIIASCII-48LOG10(ASCII-48)LOG10((ASCII-48)*0.9+1)INT(LOG10((ASCII-48)*0.9+1)
'0'480n/a0,000
'1'4910,000,280
'2'5020,300,450
'3'5130,480,570
'4'5140,600,660
'5'5250,700,740
'6'5460,780,810
'7'5570,850,860
'8'5680,900,910
'9'5790,950,960
'A'65171,231,211
'B'66181,261,241
'C'67191,281,261
'D'68201,301,281
'E'69211,321,301
'F'70221,341,321

Let's put it together:

Readable implementation:

...

Just cut'n paste this formula, that's it.

 

Enjoy,

  Aleš

 

 

...