Changeset 63
- Timestamp:
- Nov 9, 2019, 1:38:36 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Languages/Game2048.cs.po
r51 r63 250 250 msgstr "Mocnina dvou" 251 251 252 #: ugame.sskinroman 253 msgid "Roman numerals" 254 msgstr "Římské číslice" 255 252 256 #: ugame.stileshouldbeempty 253 257 msgid "Tile should be empty" -
trunk/Languages/Game2048.po
r51 r63 240 240 msgstr "" 241 241 242 #: ugame.sskinroman 243 msgid "Roman numerals" 244 msgstr "" 245 242 246 #: ugame.stileshouldbeempty 243 247 msgid "Tile should be empty" -
trunk/UGame.pas
r56 r63 95 95 end; 96 96 97 TTileSkin = (tsLinear, tsPowerOfTwo, tsAlpha );97 TTileSkin = (tsLinear, tsPowerOfTwo, tsAlpha, tsRoman); 98 98 99 99 { TGame } … … 181 181 SSkinPowerOfTwo = 'Power of two'; 182 182 SSkinAlpha = 'Alpha'; 183 SSkinRoman = 'Roman numerals'; 183 184 STileShouldBeEmpty = 'Tile should be empty'; 184 185 … … 197 198 SkinText[tsPowerOfTwo] := SSkinPowerOfTwo; 198 199 SkinText[tsAlpha] := SSkinAlpha; 200 SkinText[tsRoman] := SSkinRoman; 199 201 end; 200 202 … … 1021 1023 end; 1022 1024 1025 function IntToStrRoman(Num: Integer): string; 1026 const 1027 Nvals = 13; 1028 Vals: array [1..Nvals] of Word = 1029 (1, 4, 5, 9, 10, 40, 50, 90, 100, 400, 500, 900, 1000); 1030 Roms: array [1..Nvals] of string[2] = 1031 ('I', 'IV', 'V', 'IX', 'X', 'XL', 'L', 'XC', 'C', 'CD', 'D', 'CM', 'M'); 1032 var 1033 B: 1..Nvals; 1034 begin 1035 Result := ''; 1036 B := Nvals; 1037 while Num > 0 do 1038 begin 1039 while Vals[b] > Num do 1040 Dec(B); 1041 Dec(Num, Vals[B]); 1042 Result := Result + Roms[B]; 1043 end; 1044 end; 1045 1023 1046 function TGame.GetTileSkinValue(Value: Integer): string; 1024 1047 begin … … 1027 1050 tsPowerOfTwo: Result := IntToStr(1 shl Value); 1028 1051 tsAlpha: Result := Chr(Ord('A') + Value - 1); 1052 tsRoman: Result := IntToStrRoman(Value); 1029 1053 else Result := IntToStr(Value); 1030 1054 end;
Note:
See TracChangeset
for help on using the changeset viewer.