C # (268) (260) (256)
นี่คือปฏิบัติการใน LINQPad โดยใช้Dump()
วิธีการ:
string b="Under the spreading chestnut tree",c="sold ",d="you ",e="and ",f="me.\nT",g="here lie ",h=" IS ";if(new Random().Next(9)>4)(b+"\nI "+c+d+e+d+c+f+g+"they, "+e+g+"we\n"+b+".").Dump();else("WAR"+h+"PEACE.\nFREEDOM"+h+"SLAVERY.\nIGNORANCE"+h+"STRENGTH.").Dump();
Ungolfed:
string b="Under the spreading chestnut tree",c="sold ",d="you ",e="and ",f="me.\nT",g="here lie ",h=" IS ";
if(new Random().Next(9)>4)
(b+"\nI "+c+d+e+d+c+f+g+"they, "+e+g+"we\n"+b+".").Dump();
else
("WAR"+h+"PEACE.\nFREEDOM"+h+"SLAVERY.\nIGNORANCE"+h+"STRENGTH.").Dump();
ปรับปรุง:
การใช้ตัวดำเนินการประกอบและตัวแปรพิเศษ 1 ตัวฉันสามารถตัดตัวอักษรอีก 6 ตัวได้:
string a,b="Under the spreading chestnut tree",c="sold ",d="you ",e="and ",f="me.\nT",g="here lie ",h=" IS ";a=new Random().Next(9)>4?(b+"\nI "+c+d+e+d+c+f+g+"they, "+e+g+"we\n"+b+"."):("WAR"+h+"PEACE.\nFREEDOM"+h+"SLAVERY.\nIGNORANCE"+h+"STRENGTH.");a.Dump();
Ungolfed:
string a,b="Under the spreading chestnut tree",c="sold ",d="you ",e="and ",f="me.\nT",g="here lie ",h=" IS ";
a=new Random().Next(9)>4 ?
(b+"\nI "+c+d+e+d+c+f+g+"they, "+e+g+"we\n"+b+".") :
("WAR"+h+"PEACE.\nFREEDOM"+h+"SLAVERY.\nIGNORANCE"+h+"STRENGTH.");
a.Dump();
Update2:
ขอบคุณคำแนะนำที่ชาญฉลาดของtsavinho
ฉันสามารถบันทึกอีก 4 ตัวอักษรโดยการจัดฟันรอบการดำเนินการประกอบไปด้วย:
string b="Under the spreading chestnut tree",c="sold ",d="you ",e="and ",f="me.\nT",g="here lie ",h=" IS ";(new Random().Next(9)>4?(b+"\nI "+c+d+e+d+c+f+g+"they, "+e+g+"we\n"+b+"."):("WAR"+h+"PEACE.\nFREEDOM"+h+"SLAVERY.\nIGNORANCE"+h+"STRENGTH.")).Dump();
Ungolfed:
string b="Under the spreading chestnut tree",c="sold ",d="you ",e="and ",f="me.\nT",g="here lie ",h=" IS ";
(new Random().Next(9)>4?
(b+"\nI "+c+d+e+d+c+f+g+"they, "+e+g+"we\n"+b+"."):
("WAR"+h+"PEACE.\nFREEDOM"+h+"SLAVERY.\nIGNORANCE"+h+"STRENGTH.")
).Dump();