الفريق العربي للبرمجةأرشيف المنتديات · 2000 – 2023
نسخة أرشيفية للقراءة فقط — التسجيل والمشاركة مغلقان، والمحتوى محفوظ كما كان.

Robocode

بدأه Mourad-b في 4 أكتوبر 2008 · 4 رد · 746 مشاهدة · في JavaSE
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

salam 3alaikom wa ra7mato Allah ta3ala wa barakatoh,

fist of all : i'm new in the Arabteam2000-forum.com :), this is my first post, and i want to talk about the game : Robocode, does anybody know a thing about it ?

you can download it , its a game that you have to program it in java :) really cool game. i have to made a Robot that have to win 60 - 100% the sample.Walls :)

sorry for the launguage, i'm dutch/marokkan so i have a a dutch keyboard :P, but i understand arabic really good, and i can writ it also, i just dont have a arabic keyboard :S .

thax!

#2

لم أجد أي وصلة للتحميل

هل أخطأت الفهم؟؟

تحياتي

حزمة المحرك الإصدارة 0.8

أي أحد يجد أني ظلمته فليراسلني

وبإذن الله لو كان له حق سيأخذه

728x90.png

#4

سلام

جربتة

و دوخني ال Walls :wacko: في البداية

بس هذا البوت جربتة هو وال walls لوحدهم ونسبة نجاحة 75% تقريبا

ممكن تحاول تحسن النسبة


package aaa;
import robocode.*;
import java.awt.Color;

/**
* Ahmed - a robot by (your name here)
*/
public class Ahmed extends Robot
{
boolean fight = false;

/**
* run: Ahmed's default behavior
*/
public void run() {
// After trying out your robot, try uncommenting the import at the top,
// and the next line:
setColors(Color.white, Color.white, Color.white , Color.white , Color.white);
turnGunLeft(getGunHeading());

while(true) {
// Replace the next 4 lines with any behavior you would like

int o = getOthers();
//if ( o > 3){
double x = getX();
double y = getY();

double w = getBattleFieldWidth();
double h = getBattleFieldHeight();

double xm = w - x;
double ym = h - y;

double head = getHeading();



if ((x != w || y != h) && !fight ){
if ( head <= 90 ){
turnRight(90 - head);
turnGunLeft(getGunHeading());
ahead(xm);
}else if ( head > 90 && head <= 180 ){
turnLeft(head - 90);
turnGunLeft(getGunHeading());
ahead(xm);
}
else if ( head > 180 && head <= 270 ){
turnLeft((head - 180) + 90);
turnGunLeft(getGunHeading());
ahead(xm);
}else{
turnLeft((head - 270)+180);
turnGunLeft(getGunHeading());
ahead(xm);
}

turnRight(90);
turnGunLeft(getGunHeading());
ahead(ym);
}else{
scan();
}



}
}


/**
* onScannedRobot: What to do when you see another robot
*/
public void onScannedRobot(ScannedRobotEvent e) {
if ( (int)getGunHeading() % 90 == 0){
fire(100);
fight = true;
}else{
fire(1);
fight = false;
System.out.println("fdfdfdfdfdfdfdf" + getGunHeading());
}

}

/**
* onHitByBullet: What to do when you're hit by a bullet
*/

public void onHitByBullet(HitByBulletEvent e) {

}


}

#5

على فكرة لم أعرف كيف تلعب اللعبة

نزلتها لدي

لكني ضعت فيها

هل هي لعبة مشهورة؟؟؟

من أين يمكن قراءة شيء عنها

تحياتي

حزمة المحرك الإصدارة 0.8

أي أحد يجد أني ظلمته فليراسلني

وبإذن الله لو كان له حق سيأخذه

728x90.png