Bil Simser has just done the .NET Community a huge solid. Bil has dug up and re-released Terrarium to CodePlex wtih the intent to update it to use new language features and new usability features like ClickOnce.
胆红素Simser刚刚做了.NET社区一个巨大的固体。 Bil已挖出并将Terrarium重新发布到CodePlex,以进行更新以使用新的语言功能和新的可用性功能(如ClickOnce)。
If you're newish to the .NET Community (<3-5 years?) you might not have heard of Terrarium. There was a time when it was the tool for getting newbies excited about learning .NET. I showed dozens of high-school and college students how to program using Terrarium. Back at my last company one of our engineers did brown bag lunches on good bug design and ran a Terrarium Server internally.
如果您刚接触.NET社区(不到3-5年?),您可能还没有听说过Terrarium。 曾经有一段时间它是使新手对学习.NET感到兴奋的工具。 我向数十名高中和大学生展示了如何使用Terrarium进行编程。 回到我的上一家公司时,我们的一位工程师用出色的错误设计来做午餐,并在内部运行了Terrarium Server。
Terrarium hasn't been even looked at by the Microsoft SDK team in two years, as live happens, you know. Bil hunted them down, did a bunch of paperwork and it's back. You can check out the source or download the release.
您知道,两年来,Microsoft SDK团队甚至没有看过Terrarium。 比尔追捕他们,做了很多文书工作,回来了。 您可以签出源代码或下载发行版。
You can run it alone, just a world in a box, or you can hook it up to a server and that's where it gets interesting, as your bugs all live in a connected world.
您可以单独运行它,也可以只运行一个盒子,也可以将其连接到服务器,这很有趣,因为您的bug都生活在一个互联的世界中。
Your animals have Idle (event-based) loops that you can react to, and who amongst us hasn't wanted to write these lines of code at least once?
您的动物具有可以响应的空闲(基于事件)循环,我们中间谁不想至少一次编写这些代码行?
// Reproduce as often as possible
if (CanReproduce)
BeginReproduction(null);
Now you have the chance.
现在,您将有机会。
A great lunchtime project is to get a bunch of the nerds from your company in a room, teach them Terrarium and have a battle!
一个很棒的午餐时间项目是在一个房间里从公司里招募一群书呆子,教他们Terrarium并进行战斗!
Personally, I'm a lover, not a fighter, so I run away when attacked.
就我个人而言,我是一个情人,而不是战士,所以我在受到攻击时会逃跑。
private void MyAnimal_Attacked(object sender, AttackedEventArgs e)
{
if (e.Attacker.IsAlive)
{
AnimalState TheAttacker = e.Attacker;
BeginDefending(TheAttacker); //defend against the attacker
WriteTrace("Run away to some random point");
int X = OrganismRandom.Next(0, WorldWidth - 1);
int Y = OrganismRandom.Next(0, WorldHeight - 1);
BeginMoving(new MovementVector(new Point(X, Y), 10));
}
}
Go check out the release of Terrarium and download the app, SDK and server. There will be more to come on Bil's Blog, I'm sure. He'll also be running a public Terrarium Server. It's exciting to see this blast from the past. Now I think it's time for me to visit a local High School Computer Science class again some lunchtime...
去检查Terrarium的发行版并下载应用程序,SDK和服务器。 我敢肯定, Bil的博客上还会有更多内容。 他还将运行公共Terrarium服务器。 看到过去的爆炸声令人兴奋。 现在我想是时候该在午餐时间再次参观当地的高中计算机科学课了...
One of the things I think will be interesting to see, is if folks come up with better patterns for managing state within these animals. Many Terrarium animals end up with Idle loops that look like Arrow Code.
我认为有趣的一件事就是人们是否想出更好的模式来管理这些动物的状态。 许多玻璃容器动物最终都处于类似于箭头代码的空闲循环。
if
if
if
if
do something
endif
endif
endif
endif
This isn't nice to look at, and it would promote bad habits if it was the first kind of code someone new to programming ever saw.
这看起来不好,而且如果它是编程新手所见的第一类代码,则会养成不良习惯。
The world has changed since this was released in 2002. The race is on and now I ask:
自2002年发布以来,世界已经发生了变化。比赛正在进行中,现在我问:
Enjoy!
请享用!
UPDATE: I've got this running on my XP machine and my XP VMs but because of missing DirectX 6/7 DLLs I can't get it running under Vista. Possible workaround in the comments below. It'll likely be faster to just recompile it. I'll talk to Bil and see what's up.
更新:我已经在XP机器和XP VM上运行了该程序,但是由于缺少DirectX 6/7 DLL,我无法使其在Vista下运行。 可能的解决方法在下面的评论中。 重新编译它可能会更快。 我将与Bil交谈,看看情况如何。
Related Links
相关链接
Five Year Old Tutorial on how to Write An Animal for Terrarium.
翻译自: https://www.hanselman.com/blog/learning-opportunity-net-terrarium-is-back