Code samples
Watched several videos on youtube. then downloaded code samples from this site. I don't know about GitHub and how to use it. Anyhow, there are 3 folders in each lesson. Activities, Examples, and Solution. I just want to know how to use them effectively. Of course, I use NetBeans8. Also, I don't know whether this issue is suitable or not for this type of the question. from [email protected]
Hi the Examples folder contains the code I use in the videos The activities folder contains exercises you can try on your own. The answers to the activities are in the Solutions folder.
Dear Mr. Fudge
Thank you very much for your kind advice. I didn’t know the lesson 00 video. I’ve got the video today and understood the preparation of the environment.
I’ve just started to learn Java after I watched a few video on Youtube. Most interested thing in your video is using “debug” tools. I’ve been learning C# and ASP.NET on the Visual Studio since 2008.
Only purpose to learn Java is to stimulate my brain cells for anti-dementia because I’m 74 years old already.
I’m sure I can enjoy learning Java for long.
Thank you.
Masami kitada
From: Michael Fudge [mailto:[email protected]] Sent: Saturday, February 28, 2015 10:03 AM To: mafudge/LearnJava Cc: masami kitada Subject: Re: [LearnJava] Code samples (#1)
Hi the Examples folder contains the code I use in the videos The activities folder contains exercises you can try on your own. The answers to the activities are in the Solutions folder.
— Reply to this email directly or view it on GitHub https://github.com/mafudge/LearnJava/issues/1#issuecomment-76500650 . https://github.com/notifications/beacon/AKt18b9h7S6npOFHDVmoZTuztYOKtbKeks5nwQs7gaJpZM4DnTCl.gif
Hi Mike,
Please find code written when following your example and kindly assist rectify as am getting so many red errors....................... import dungeonhack.*; import dungeonhack.Actor; import dungeonhack.Die; import dungeonhack.Weapon;
/**
- the beginning of a new super cool dungeon hack simulator
- Roll 20 side die
- if ( roll >= monster armor class){
- inflict damage on monster
- check if monster is dead
- else check if you miss */
public class DungeonHackRun {
public static void main(String[] args) {
Weapon sword = new Weapon("Broad Sword","slashes",10);
Weapon claw = new Weapon("Arm","Claw",6);
Actor player = new Actor("Conan the Barbarian",5,10,sword);
Actor monster = new Actor("Grumpy troll",5,8,claw);
Die d20 = new Die(20);
int roll = d20.roll();
//"conan the barbarian slashes is broad sword at the grumpy troll...."
System.out.printf("%s %s his %s at the %s and",player.name(),player.weapon().action(),
player.weapon().action(),monster.name());
if (roll>= monster.armorClass()){ //hit
int damage = player.weapon().hitDamage();
monster.takeDamage(damage);
System.out.printf("hit for %d damage",damage);
if(monster.isDead()){
System.out.println(",killing hit");
}
}else{ //miss
System.out.println("misses");
}
System.out.print("!!!");
}
}
Yo Mr. Fudge,
new to this. Stumbled over your Java tutorial. Here to learn. Thanks for helping out and your work. Appreciated.