Щoгкeгs of tиe щoгld, цпite!
Iпtгodцctioп
Iп tиe Iпteгпets, people sometimes liкe to stчlize tиeiг posts дs if tиeч щeгe щгitteп iп д diffeгeпt scгipt. Tидпкs to tиe пotoгietч of Soviet Яцssiд, tиe Cчгчlic scгipt seems to бe pдгticцlдгlч fдvoгed.
Бцt щидt cдп д пext-dooг tгoll do if tиeч'гe пot д pгogгдmmeг? Mдпцдllч гeplдciпg eдcи дпd eveгч letteг cдп бe qцite tedioцs...
Cидlleпge
Чoц дгe to щгite д pгogгдm tидt щill дccept дп дгбitгдгilч loпg iпpцt of Lдtiп cидгдcteгs дпd sцбstitцte some letteгs щitи similдгlч looкiпg Cчгчlics cидгдcteгs. Tиe oцtpцt sиoцld бe ideпticдl to tиe oцtpцt pгodцced бч tиe folloщiпg цпgolfed C# scгipt:
цsiпg Sчstem;
цsiпg Sчstem.Collectioпs.Geпeгic;
цsiпg Sчstem.Liпq;
pцбlic clдss Test
{
pцбlic stдtic void Mдiп()
{
Dictioпдгч<cидг, cидг> tгдпs = пeщ Dictioпдгч<cидг, cидг>{
{'A', 'д'},
{'a', 'д'},
{'B', 'Б'},
{'b', 'б'},
{'N', 'И'},
{'b', 'и'},
{'K', 'К'},
{'k', 'к'},
{'N', 'П'},
{'n', 'п'},
{'R', 'Я'},
{'r', 'г'},
{'U', 'Ц'},
{'u', 'ц'},
{'W', 'Щ'},
{'w', 'щ'},
{'Y', 'Ч'},
{'y', 'ч'}
};
stгiпg s; щиile((s = Coпsole.ЯeдdLiпe()) != пцll) {
Coпsole.ЩгiteLiпe(
пeщ stгiпg(s.Select(c => tгдпs.CoпtдiпsКeч(c) ? tгдпs[c] : c).
Toдггдч()
)
);
}
}
}
Tиe sиoгtest code щiпs.
Exдmple Iпpцt дпd Oцtpцt
Iпpцt:
As we know, the goal of every struggle is victory. But if the
proletariat is to achieve victory, all the workers, irrespective of
nationality, must be united. Clearly, the demolition of national
barriers and close unity between the Russian, Georgian, Armenian,
Polish, Jewish and other proletarians is a necessary condition for the
victory of the proletariat of all Russia.
We are for the withering away of the state, and at the same time we
stand for the strengthening of the dictatorship of the proletariat,
which represents the most powerful and mighty of all forms of the
state which have existed up to the present day. The highest
development of the power of the state, with the object of preparing
the conditions of the withering away of the state: that is the Marxist
formula. Is it "contradictory"? Yes, it is "contradictory." But this
contradiction is a living thing and wholly reflects the Marxist
dialectic.
Oцtpцt:
дs щe кпoщ, tиe goдl of eveгч stгцggle is victoгч. Бцt if tиe
pгoletдгiдt is to дcиieve victoгч, дll tиe щoгкeгs, iггespective of
пдtioпдlitч, mцst бe цпited. Cleдгlч, tиe demolitioп of пдtioпдl
бдггieгs дпd close цпitч бetщeeп tиe Яцssiдп, Geoгgiдп, дгmeпiдп,
Polisи, Jeщisи дпd otиeг pгoletдгiдпs is д пecessдгч coпditioп foг tиe
victoгч of tиe pгoletдгiдt of дll Яцssiд.
Щe дгe foг tиe щitиeгiпg дщдч of tиe stдte, дпd дt tиe sдme time щe
stдпd foг tиe stгeпgtиeпiпg of tиe dictдtoгsиip of tиe pгoletдгiдt,
щиicи гepгeseпts tиe most poщeгfцl дпd migиtч of дll foгms of tиe
stдte щиicи идve existed цp to tиe pгeseпt dдч. Tиe иigиest
developmeпt of tиe poщeг of tиe stдte, щitи tиe oбject of pгepдгiпg
tиe coпditioпs of tиe щitиeгiпg дщдч of tиe stдte: tидt is tиe Mдгxist
foгmцlд. Is it "coпtгдdictoгч"? Чes, it is "coпtгдdictoгч." Бцt tиis
coпtгдdictioп is д liviпg tиiпg дпd щиollч гeflects tиe Mдгxist
diдlectic.
[tag:code-golf]
\$\endgroup\$ – DJMcMayhem♦ Aug 29 at 15:19