Changeset 70 for trunk


Ignore:
Timestamp:
Feb 3, 2020, 1:24:08 AM (5 years ago)
Author:
chronos
Message:
  • Added: Binary numbers tile skin.
Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Languages/Game2048.cs.po

    r63 r70  
    242242msgstr "Písmena"
    243243
     244#: ugame.sskinbinary
     245msgid "Binary"
     246msgstr ""
     247
    244248#: ugame.sskinlinear
    245249msgid "Linear"
     
    251255
    252256#: ugame.sskinroman
    253 msgid "Roman numerals"
     257#, fuzzy
     258#| msgid "Roman numerals"
     259msgid "Roman"
    254260msgstr "Římské číslice"
    255261
     
    261267msgid "Top score"
    262268msgstr "Nejvyšší skóre"
     269
  • trunk/Languages/Game2048.po

    r63 r70  
    232232msgstr ""
    233233
     234#: ugame.sskinbinary
     235msgid "Binary"
     236msgstr ""
     237
    234238#: ugame.sskinlinear
    235239msgid "Linear"
     
    241245
    242246#: ugame.sskinroman
    243 msgid "Roman numerals"
     247msgid "Roman"
    244248msgstr ""
    245249
  • trunk/UGame.pas

    r69 r70  
    9595  end;
    9696
    97   TTileSkin = (tsLinear, tsPowerOfTwo, tsAlpha, tsRoman);
     97  TTileSkin = (tsLinear, tsPowerOfTwo, tsAlpha, tsRoman, tsBinary);
    9898
    9999  { TGame }
     
    185185  SSkinPowerOfTwo = 'Power of two';
    186186  SSkinAlpha = 'Alpha';
    187   SSkinRoman = 'Roman numerals';
     187  SSkinRoman = 'Roman';
     188  SSkinBinary = 'Binary';
    188189  STileShouldBeEmpty = 'Tile should be empty';
    189190
     
    203204  SkinText[tsAlpha] := SSkinAlpha;
    204205  SkinText[tsRoman] := SSkinRoman;
     206  SkinText[tsBinary] := SSkinBinary;
    205207end;
    206208
     
    10701072end;
    10711073
     1074function IntToBin(Num: Integer): string;
     1075begin
     1076  Result := '';
     1077  while Num > 0 do begin
     1078    Result := IntToStr(Num mod 2) + Result;
     1079    Num := Num shr 1;
     1080  end;
     1081end;
     1082
    10721083function TGame.GetTileSkinValue(Value: Integer): string;
    10731084begin
     
    10771088    tsAlpha: Result := Chr(Ord('A') + Value - 1);
    10781089    tsRoman: Result := IntToStrRoman(Value);
     1090    tsBinary: Result := IntToBin(Value);
    10791091    else Result := IntToStr(Value);
    10801092  end;
Note: See TracChangeset for help on using the changeset viewer.