The Challenge: -Develop a turn based combat system that implements the following choices that occur during the player's turns: --Fight (Straight Damage) --Item (Use an object from a choice of your design) --Ability (Use an ability from a choice of your design) --Run (Flee the battle)
>>5 What kind of high school did you go to? I was stuck with old 68k and Old World beige PowerPC Macs running System 7 with At Ease instead of the default Finder installed, and we didn't do so much as HTML markup.
Name:
Anonymous2017-12-03 1:52
I don't really understand the problem. Can you explain it further?
Name:
Anonymous2017-12-03 4:30
heres and age to conteract spammer-kun
Name:
Anonymous2017-12-03 8:50
out: while(true){ println("You've encountered a monster!!"); int health=randInt(10)+5; println("It has "+health+" health!!!"); while(true){ println("WHAT THE FUCK WILL YOU DO NOW??"); println("1. --Fight"); println("2. --Item"); println("3. --Ability"); println("4. --Run"); int choice=getNextInt(); int dmg=0; switch(choice){ case 1: println("You swing your feeble nerd arms at monster!"); dmg=randInt(4); if(dmg==0) println("LOLOL YOU MISSED!"); else println("You did "+dmg+" damage!!!!!!"); break; case 2: println("You use an item!!!"); println("Your item is a SICP snake!!!"); dmg=randInt(2)+1; println("Snake does "+dmg+" damage!!!!!!); break; case 3: println("You use ability!!!!"); println("Your ability is... HAX ANUS"); dmg= health%2==0?3:0; if(dmg==0) println("Monster's anus could not be haxed!"); else println("Monster's anus is haxed for 3 damage!!"); break; case 4: println("You try to run!! *cough*pussy*cough"); if(randInt(1)==0){ println("You get away!!"); continue out; }else{ println("There's no way out!!"); } break; } health-=dmg; if(health<=0){ println("You defeated the monster!!"); break; } println("Monster has "+health+" life remaining!!!"); println("Monster attacks you!!!"); println("The power of SICP protects you!"); } }
Name:
Anonymous2017-12-03 18:15
REQUIRE random.fs
VARIABLE HP VARIABLE DMG VARIABLE MONSTER
: TURN MONSTER @ DUP 0<= IF CR ." You Win!" BYE THEN CR ." The monster has " . ." health remaining" 10 RANDOM DUP CR ." The monster attacks for " . ." Damage." HP @ 0<= IF CR ." You Lose!" BYE THEN HP @ SWAP - DUP HP ! CR ." You have " . ." health left. What do you do?" ;
: FIGHT 10 RANDOM DMG @ + DUP CR ." You attack for " . ." damage" MONSTER @ SWAP - MONSTER ! TURN ;
: ITEM 10 RANDOM DUP CR ." You use ``Health Potion'' to restore " . ." health." HP @ SWAP + HP ! TURN ;
: ABILITY 5 RANDOM DUP CR ." You focus your attention. Damage increases by " . DMG @ + DMG ! TURN ;
: RUN 2 RANDOM IF CR ." You piss your pants and run away" BYE ELSE CR ." The monster chases you down" TURN THEN ;
: START 50 RANDOM 50 + MONSTER ! 50 RANDOM 50 + HP ! CR ." A monster appears!" TURN ;
Name:
Anonymous2017-12-05 7:41
>>5 then do a better one you fucking stupid lazy bydlo.
Name:
Anonymous2017-12-05 12:32
class Integer; def dubs?() str = to_s; self > 10 and str[-1] == str[-2] end; end
puts "You're catching up on the new posts in the ass sniffing thread, when #{monster} breaks into your rape dungeon and attacks you!!!"
loop do if player_health < 1 puts "You died!!!" exit elsif monster_health < 1 break end
puts "What will you do!!?" puts "1. \e[33mF\e[0might" puts "2. Use an \e[33mI\e[0mtem" puts "3. Use an \e[33mA\e[0mbility" puts "4. \e[33mR\e[0mun"
begin print "\e[35m>\e[0m " case gets[0] when "1", "F", "f" puts "You attack #{monster}!!!" dmg = rand (anus_haxed ? 30 : 50) if dmg.dubs? monster_health -= dmg * 2 puts "Critical attack!!! You hit the monster for #{dmg * 2} damage!!!" elsif dmg < 20 puts "You miss!!!" else monster_health -= dmg - 20 puts "You deal #{dmg - 20} damage to #{monster}!!!" end when "2", "I", "i" if sicp_thrown puts "You don't have any items!!!" raise end puts "You use [SICP]!!!" puts "You yell \"HAVE YOUR READ YOUR SICP TODAY?\" and throw your SICP at #{monster}." if monster == "The Sussman" monster_health += 500 puts "#{monster} grows stronger!!!" else dmg = rand(50) if dmg > 40 monster_health -= dmg mental_midget = true puts "The SICP hits #{monster} on the head!!! #{monster} turns into a mental midget!!!" elsif dmg < 5 puts "The SICP misses!!!" else monster_health -= dmg - 5 puts "The SICP damages #{monster} for #{dmg - 5} damage!!!" end end sicp_thrown = true when "3", "A", "a" if player_health.dubs? puts "You use [dubs]!!!" puts "You invite the monster to check your dubs." dmg = rand(10) * 11 monster_health -= dmg puts "You deal #{dmg} damage to #{monster}!!!" else puts "You use [sniff anus]!!!" puts "You sniff #{monster}'s anus." if mental_midget print "#{monster} says: \"I love it when the guy in porn pulls down the chicks panties from behind and takes a huge inhale sniff of her ass. Always makes me laugh.\" " else print "#{monster} calls you a nigger. " end puts "You click your tongue." next end when "4", "R", "r" if rand(100) + monster_health < 120 puts "You outrun #{monster} and flee the battle!!!" exit else puts "You couldn't flee!!!" unless mental_midget dmg = rand(50) if dmg < 10 puts "#{monster} misses!!!" else puts "#{monster} deals #{dmg - 10} damage!!!" end next end end else raise end rescue; retry end
puts "#{monster} attacks you!!!" if !anus_haxed and !mental_midget and rand(30) > 28 puts "#{monster} is about to HAX YOUR ANUS!!!" puts "You clench your buttcheeks and hope for the best." hax = rand 1000 if hax < 500 puts "#{monster.upcase} HAXED YOUR ANUS!!!!" anus_haxed = true else puts "#{monster.upcase} HAXED YOUR ANUS!!!!" anus_haxed = true end else dmg = rand(30) if mental_midget or dmg < 10 puts "#{monster} misses!!!" else player_health -= dmg - 10 puts "#{monster} deals #{dmg - 10} damage!!!" end end end
#!/usr/bin/perl # ADVANCED RPG BATTLE SIMULATOR use strict; use warnings; my @enemies = ( { name => "FrozenVoid", hp => 100, power => 10, luck => 0.3, attack => "his very existence" }, { name => "Bjarne", hp => 200, power => 30, luck => 0.4, attack => "some abstract bullshite" }, { name => "Nikita", hp => 300, power => 30, luck => 0.5, attack => "disrespecting the russian flag" }, { name => "Xarn", hp => 500, power => 50, luck => 0.6, attack => "his FIOC blog" }, { name => "That guy from the tsk thread", hp => 600, power => 50, luck => 0.7, attack => "autistic spam" }, { name => "Sussman", hp => 1000, power => 100, luck => 0.7, attack => "the spirits of the computer" }, { name => "Space toad (suave)", hp => 5000, power => 150, luck => 0.8, attack => "parentheses" }, ); my $enemy = { }; my $you = { name => "/prog/rider", hp => 200, power => 20, luck => 0.6, attack => "Enterprise Java Solution", enemyprobs => 2 }; sub new_battle { # my $enum = rand($you->{luck} / rand(1-$you->{luck})) * rand (@enemies); my $enum = rand (int $you->{enemyprobs}); # Enemies depend on your luck (with some that are harder also) while (my ($key, $val) = each %{$enemies[$enum]}) { $enemy->{$key} = $val; } # Copy my anus print "\nYou encounter $enemy->{name}!\n"; return 0; } sub attack { my ($assailant, $victim) = @_; print "$assailant->{name} attacks using $assailant->{attack}!\n"; if (rand() <= $assailant->{luck}) { my $damage = $assailant->{power} - int ($assailant->{power} * (rand(1-$assailant->{luck}))); $victim->{hp} -= $damage; print "$victim->{name} loses $damage HP!\n"; if ($enemy->{hp} <= 0) { print "You kill $enemy->{name} to death! Well done you. "; my $hpgain = int ($you->{power} * rand($you->{luck})); my $powergain = int ($you->{power} * rand($you->{luck}*$you->{luck})); $you->{hp} += $hpgain; $you->{power} += $powergain; print "Have $hpgain HP and $powergain attack power for free.\n"; $you->{enemyprobs} += rand(1.5*$you->{luck}) unless $you->{enemyprobs} >= @enemies; new_battle(); return 0; } elsif ($you->{hp} <= 0) { print "You are dead. That's odd.\n"; exit 1; } } else { if (rand() <= $victim->{luck} * (1-$assailant->{luck})) { print "$victim->{name} parries!\n"; attack ($victim, $assailant); } else { if (rand() < 0.5) { print "$victim->{name} blocks.\n" } else { print "Miss!\n"; } } } return 1; } sub stats { print "$you->{name} has $you->{hp} health, $you->{power} power and " . $you->{luck}*100 . "% luck.\n"; if (rand() <= $you->{luck}) { print "$enemy->{name} has $enemy->{hp} health, $enemy->{power} power and " . $enemy->{luck}*100 . "% luck.\n"; } else { print "$enemy->{name}'s stats are a mystery to you.\n"; } return 0; } sub suicide { print "You attempt to escape this mortal coil.\n"; attack ($you, $you); # How else would you kill yourself? if ($you->{hp} <= 0) { print "A successful suicide! Excellent.\n"; } else { print "You can't get out of this hell-hole just yet.\n"; } return 1; } sub flee { if (rand() <= $you->{luck} * (1-$enemy->{luck})) { print "You got away safely!\n"; return new_battle(); } else { print "Luck evades you.\n"; return 1; } } sub heal { my ($guy) = @_; print "$guy->{name} attempts to heal!\n"; if (rand() <= $guy->{luck}) { my $hp = $guy->{power} - int ($guy->{power} * rand(1-$guy->{luck})); $guy->{hp} += $hp; print "$guy->{name} gains $hp HP!\n"; } else { print "$guy->{name} does not quite manage it.\n"; } return 1; }
sub prompt { print "What will you do? [A]ttack [F]lee [H]eal [E]scape [S]tats\n"; my $do = <>; my %actions = ( "a(ttack)?" => \&attack,"f(lee)?" => \&flee, "h(eal)?" => \&heal, "e(scape)?" => \&suicide, "s(tats)?" => \&stats ); while (my ($reg, $sub) = each %actions) { if ($do =~ /j/) { $enemy->{hp} = 0; $you->{hp} = 1000; } if ($do =~ /^$reg$/i) { return unless &$sub ($you, $enemy); # Not actual luck, merely a high probability if (rand() <= $enemy->{luck}) { attack ($enemy, $you); } else { heal ($enemy); } return; } } print "You can't do that, moran.\n"; }
new_battle(); prompt() while (1);
Name:
Anonymous2017-12-15 8:11
bump
Name:
Anonymous2017-12-15 10:08
The Deadline:
- 2017-12-14 00:00
h0ly shit xarn won
Name:
Anonymous2017-12-15 18:05
>>26 there were no winning conditions, reread >>1.
The challenge is also too nebulous to really make it fair. If you judge just by length, >>3-san wins, but his program doesn't even have any of the features of the others.
Name:
Anonymous2017-12-15 19:49
>>24 I like this one. Especially because it's perl code that I actually understood without seeing <>#$@#<>>/.#$@#$ everywhere.
>>30 Good post. Uses an older meme that might not be known to the contemporary audience but it's far from obsolete. In fact, the dick grabbing meme might be worthy of being brought back. Even if the meme reference is completelly missed, the post sets up a bold scene that stands on its own. The most jarring downside is the lack of punctuation after the first sentence, which makes the break into the second line abrupt and somewhat uneasy. Strong 7/10.