Sample Code: Making Robots in Java (JRobot) نموذج رمز : صنع الروبوتات في يافا (jrobot)
I talked about لقد تحدثت عن JRobots, an extremely addictive Java game Jrobots وهو امر بالغ الادمان لعبة جافا where you develop robots in java to fight against other JRobots in a monthly battle royale. اين وضع الروبوتات في يافا لمكافحة jrobots اخرى في شهري معركة royale. Today I will present you with a simple sample JRobot to encourage you to participate in this contest. اليوم سأقدم لك عينة بسيطة jrobot اشجعكم على المشاركة في هذه المسابقة. It kicks the butt of all sample JRobots provided in the download bundle and even some veterans. ركلات انها هدف للجميع jrobots العينه المقدمة في تنزيل حزمة ، بل وحتى بعض قدامى المحاربين.
JRobots developers are hesitant to provide actual code because of two reasons; Jrobots مطوري تتردد في تقديم قانون الفعليه بسبب سببين ؛
1. It will lead to proliferation of copy-cat JRobots with a different name which are just a waste of time for all. وسيؤدي ذلك الى انتشار نسخ القط jrobots مع اسم مختلف والتي هي مجرد مضيعه للوقت للجميع.
2. Nobody likes to reveal their secrets لا احد يحب الافصاح عن اسرار ![]()
I have considered them over the years. وأنا أعتبر منهم على مر السنين. I have come to the conclusion that the benefits of providing simple code for developers to begin with far outweighs other concerns. لقد توصلت الى استنتاج مفاده ان تقديم فوائد بسيطة قانون للمطورين ان تبدأ الآن مع تفوق غيرها من الشواغل. So here is a simple JRobot which despite its simplicity can really kick butt of many JRobots. حتى هنا هو مجرد jrobot الذي رغم بساطة يمكن حقا هدف للكثير من ركلة jrobots. It was initially released as CounterStrike. وكان في البداية المفرج counterstrike. However now the CounterStrike code is slightly more sophisticated. ولكن الآن counterstrike قانون قليلا اكثر تعقيدا. So I am releasing this JRobot named Simple. لذلك فانني اطلاق هذا المسمى jrobot بسيطة.
public class __Simple_ extends JJRobot { void main() { int distance, angle = 0; while (true) { while((distance = scan(angle, 1)) == 0) angle++; cannon(angle, distance); drive(angle, 100); } } } وتمتد الطبقة العامة __simple_ (jjrobot باطلة الرئيسية () (دولي المسافة ، الزاويه = 0 ؛ بينما (صحيح) (بينما ((المسافة = المسح الضوئي (زاويه ، 1)) == 0) + + الزاويه ؛ مدفع (الزاويه ، المسافة) ؛ محرك الأقراص) الزاويه ، 100) ؛))) Download the source تحميل المصدر here هنا .
You can see how easy it is to start coding JRobots. يمكنك ان ترى كم هو سهل أن تبدأ jrobots الترميز. What are you waiting for? ماذا تنتظر؟
See you in the arena. اراكم في الساحة. My JRobots are Bizarro, Janeway, Shrike and CounterStrike. Jrobots بلادي هي bizarro ، janeway ، والصرد counterstrike.
Filed under المقدم بمقتضى Headline News أهم الانباء , ، How To كيف , ، Java Software برنامج جافا , ، Web شبكة , ، Web Services خدمات الشبكه العالمية | |
| |
RSS 2.0 ار اس اس 2،0 | |
Trackback this Article | هذه المادة |
Email this Article ارسل هذه المادة
You may also like to read ويمكنك ايضا ان تقرأ |




































May 5th, 2006 at 11:55 am الخامس ايار / مايو ، 2006 في الساعة 11:55
necesito el codigo fuente del juego del gato en java … por favor atuda necesito el codigo fuente juego دل دل غاتو ان جافا… por صالح atuda