Esim - [转载]玩游戏就能学会编程
Login:
Password:

Forgot password Register

Article

vwwj


Redactor

151


12
[转载]玩游戏就能学会编程 (Fun)
Posted 11 years ago by
vwwj    
Report


本文转载自驱动之家

CodeCombat是一个通过玩游戏来学习编程的网站,也是GitHub上最大的开源CoffeeScript(一种脚本语言,类似JavaScript)项目,有上千程序员和玩家为其编写程序、测试游戏。到目前为止,已经翻译成17种国外语言。最近,该网站将所有源代码提交到GitHub上,实现了全面开源。
官方称,他们网站的任务就是教会人们如何编程,游戏覆盖编程菜鸟到大神各个阶段,总共超过9千关。人们不需要任何编程知识即可了解程序的运行逻辑,并编出实用的代码。

看起来像是塔防游戏——《王城保卫战》,但却是一款即时战略游戏。

每关都会有对话讲解如何操作(遗憾没有中文)

左侧是游戏界面,右侧是代码界面,通过在右侧输入关键语句代码,控制左侧角色的移动和攻击等动作。

前几关非常简单,几行“上下左右”和“攻击”的代码即可完成通关。

每关结束后都有个回顾,告诉你在上一关学到了什么。

当输入错误,比如大小写错误,在代码下方会提示具体的出错信息,玩家可以据此Debug。

第二关中,你要先去右边吃蘑菇变强,再去击杀怪物。(点击图片查看具体代码,其实向右移动一步即可迟到蘑菇,代码中是两步)

第三关,在击杀第一个怪物后,角色的血也不多了,所以要先去下方喝药瓶。

下去喝药瓶,输入代码按回车,角色就会照做。

第四关
前N关都是编程中最基本的顺序语句,随着关数的提升,像“if…else,then”等判断、循环语句也会逐渐加入,可玩性越来越高。玩家在不知不觉也就具备了编程思维。

codecombat 网站地址:http://codecombat.com/

Previous article:
[新手]提高战斗性价比的建议 (11 years ago)

Next article:
如何最优化的设置军垦工厂 (11 years ago)

ESim
or
Register for free:
Only letters, numbers, underscore and space are allowed (A-Z,a-z,0-9,_,' ')
Show more

By clicking 'Sign Up!', you agree to the Rules and that you have read the Privacy Policy.

About the game:


USA as a world power? In E-Sim it is possible!

In E-Sim we have a huge, living world, which is a mirror copy of the Earth. Well, maybe not completely mirrored, because the balance of power in this virtual world looks a bit different than in real life. In E-Sim, USA does not have to be a world superpower, It can be efficiently managed as a much smaller country that has entrepreneurial citizens that support it's foundation. Everything depends on the players themselves and how they decide to shape the political map of the game.

Work for the good of your country and see it rise to an empire.

Activities in this game are divided into several modules. First is the economy as a citizen in a country of your choice you must work to earn money, which you will get to spend for example, on food or purchase of weapons which are critical for your progress as a fighter. You will work in either private companies which are owned by players or government companies which are owned by the state. After progressing in the game you will finally get the opportunity to set up your own business and hire other players. If it prospers, we can even change it into a joint-stock company and enter the stock market and get even more money in this way.


In E-Sim, international wars are nothing out of the ordinary.

"E-Sim is one of the most unique browser games out there"

Become an influential politician.

The second module is a politics. Just like in real life politics in E-Sim are an extremely powerful tool that can be used for your own purposes. From time to time there are elections in the game in which you will not only vote, but also have the ability to run for the head of the party you're in. You can also apply for congress, where once elected you will be given the right to vote on laws proposed by your fellow congress members or your president and propose laws yourself. Voting on laws is important for your country as it can shape the lives of those around you. You can also try to become the head of a given party, and even take part in presidential elections and decide on the shape of the foreign policy of a given state (for example, who to declare war on). Career in politics is obviously not easy and in order to succeed in it, you have to have a good plan and compete for the votes of voters.


You can go bankrupt or become a rich man while playing the stock market.

The international war.

The last and probably the most important module is military. In E-Sim, countries are constantly fighting each other for control over territories which in return grant them access to more valuable raw materials. For this purpose, they form alliances, they fight international wars, but they also have to deal with, for example, uprisings in conquered countries or civil wars, which may explode on their territory. You can also take part in these clashes, although you are also given the opportunity to lead a life as a pacifist who focuses on other activities in the game (for example, running a successful newspaper or selling products).


At the auction you can sell or buy your dream inventory.

E-Sim is a unique browser game. It's creators ensured realistic representation of the mechanisms present in the real world and gave all power to the players who shape the image of the virtual Earth according to their own. So come and join them and help your country achieve its full potential.


Invest, produce and sell - be an entrepreneur in E-Sim.


Take part in numerous events for the E-Sim community.


forum | Terms of Service | Privacy policy | Support | Wikia | Alpha | Luxia | Primera | Secura | Suna | Viva | Lima | Elysia | esim political game
PLAY ON