设置
吉姆是一个试图用堆栈溢出来做作业的学生,他问如何让他的程序在100行代码中说"Hello“,你认为仅仅使用致命的操作是不够的。
挑战
您需要为Jim提供一个长度小于100行的程序,该程序以另一种语言输出满意的答案。额外语言加分。
规则
获胜者是迈克尔,他首先在六种语言之间进行了转换。
我还将对McMillin使用一个在多种语言中工作的命令的聪明给予荣誉的奖励。
我也给共产国际一个荣誉的奖励..。我不知道布朗尼是否是一种语言,但我想我们可以同意它是非正统的。
我不认为任何答案都是邪恶的,但为了这一点,所有使用脑脑术的人都会被认为是受惠者。
发布于 2014-03-13 20:48:27
atob("bWFpbigpe3B1dHMoImVjaG8gXCJjb25zb2xlLmxvZygnKysrKysrWz4rKysrKysrKysrKys8LV0+LicpO1wiOyIpO30=")这一产出如下:
main(){puts("echo \"console.log('++++++[>++++++++++++<-]>.');\";");}其中产出:
echo "console.log('++++++[>++++++++++++<-]>.');";其中产出:
console.log('++++++[>++++++++++++<-]>.');其中产出:
++++++[>++++++++++++<-]>.其中产出:
H其中产出:
Hello World!发布于 2014-03-13 20:57:32
echo Bonjour tout le monde用一种叫做法语的语言输出"Hello“。
发布于 2014-03-14 00:38:49
using System;
using System.Text;
namespace Greetings
{
class Program
{
static string[] ingredients = {" vegetable oil "," eggs "," boiling water "," vanilla "," cocoa powder "," flour "," sugar "," baking soda "," salt "};
static string[] measures = {" tablespoons"," dashes"," heaped tablespoons",""," pinches"};
static int[] amounts = {154,32,157,127,110,145,164,141,154};
static int[] units = {0,3,0,1,2,2,2,4,4};
static int[] steps = {4,7,0,8,2,1,3,5,0,6};
static void Main(string[] args)
{
StringBuilder sb = new StringBuilder("Fudge Brownies.\n\nThis recipe makes an absurd amount of brownies for one person.\n");
sb.Append("\nPre-heat oven to 175 degrees Celsius.\n\nIngredients.\n");
for (int i = 0; i < ingredients.Length; i++)
{
sb.Append(amounts[i]);
sb.Append(measures[units[i]]);
sb.Append(ingredients[i]);
sb.Append("\n");
}
sb.Append("\nMethod.\n");
for (int i = 0; i < steps.Length; i++)
{
sb.Append("Put");
sb.Append(ingredients[steps[i]]);
sb.Append("into the mixing bowl.\n");
}
sb.Append("Liquefy contents of the mixing bowl.\nPour contents of the mixing bowl into the baking dish.\n");
sb.Append("\nCooking time: time 40 minutes.\n\nServes 1.");
Console.WriteLine(sb);
}
}
}上面的C#代码输出下面的主厨代码(也是美味的布朗尼食谱)。
Fudge Brownies.
This recipe makes an absurd amount of brownies for one person.
Pre-heat oven to 175 degrees Celsius.
Ingredients.
154 tablespoons vegetable oil
32 eggs
157 tablespoons boiling water
127 dashes vanilla
110 heaped tablespoons cocoa powder
145 heaped tablespoons flour
164 heaped tablespoons sugar
141 pinches baking soda
154 pinches salt
Method.
Put cocoa powder into the mixing bowl.
Put baking soda into the mixing bowl.
Put vegetable oil into the mixing bowl.
Put salt into the mixing bowl.
Put boiling water into the mixing bowl.
Put eggs into the mixing bowl.
Put vanilla into the mixing bowl.
Put flour into the mixing bowl.
Put vegetable oil into the mixing bowl.
Put sugar into the mixing bowl.
Liquefy contents of the mixing bowl.
Pour contents of the mixing bowl into the baking dish.
Cooking time: time 40 minutes.
Serves 1.最困难的部分是对食谱进行单元转换,它确实制造了大量的巧克力饼,甚至对一大群人来说也是如此。当运行一个厨师翻译时,它输出:
Hallo Welt或者德语里的“你好世界”。我不确定“布朗尼”在技术上是否构成一种语言。如果是的话,它可能不是图灵完整的。
https://codegolf.stackexchange.com/questions/24104
复制相似问题