# Text Fighting (Gladitorial) Sim

**URL:** <https://www.ruby-forum.com/t/text-fighting-gladitorial-sim/186688>\
**Category:** Ruby\
**Created:** [April 11, 2010, 4:45pm UTC](https://www.ruby-forum.com/t/text-fighting-gladitorial-sim/186688 "2010-04-11T16:45:09Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![wizofozz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/d78d45/32.png) [@wizofozz](https://www.ruby-forum.com/u/wizofozz)\
**Post date:** [April 11, 2010, 4:45pm UTC](https://www.ruby-forum.com/t/text-fighting-gladitorial-sim/186688/1 "2010-04-11T16:45:09Z")

</div>

I am attempting to create a gladitorial fighting sim. It will be able to  
pit two players (computer controlled) and based on stats, weapons, armor  
and some randomness will attack, deal damage, dodge and counter attack.  
What would be the easiest way to go about doing this. The outcome will  
be in a play-by-play format, printed on screen and also saved as a text  
document. The players stats will be saved and would earn experience  
based on the difficulty of the battle. I appreciate any response.

Very Respectfully,  
Wiz

---

<div class="post-metadata">

**Author:** ![wizofozz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/d78d45/32.png) [@wizofozz](https://www.ruby-forum.com/u/wizofozz)\
**Post date:** [April 11, 2010, 6:39pm UTC](https://www.ruby-forum.com/t/text-fighting-gladitorial-sim/186688/2 "2010-04-11T18:39:42Z")

</div>

Take a look at Ryan B.'s Ruby Warrior?

> **[GitHub - ryanb/ruby-warrior: Game written in Ruby for learning Ruby and...](https://github.com/ryanb/ruby-warrior)**
>
> Game written in Ruby for learning Ruby and artificial intelligence. - GitHub - ryanb/ruby-warrior: Game written in Ruby for learning Ruby and artificial intelligence.

---

<div class="post-metadata">

**Author:** ![wizofozz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/d78d45/32.png) [@wizofozz](https://www.ruby-forum.com/u/wizofozz)\
**Post date:** [April 11, 2010, 6:43pm UTC](https://www.ruby-forum.com/t/text-fighting-gladitorial-sim/186688/3 "2010-04-11T18:43:40Z")

</div>

Pier-Luc Caron St-Pierre wrote:

> Take a look at Ryan B.'s Ruby Warrior?
> 
> [GitHub - ryanb/ruby-warrior: Game written in Ruby for learning Ruby and artificial intelligence.](http://github.com/ryanb/ruby-warrior)

Yeah ive taken a look at that. Not really what im looking for though,  
this is more of a simulation, you tell the computer to use these two  
gladiators and then it does the simulation on its own, figuring out the  
outcome with some randomness added with the skills of the fighter. Then  
prints out a play by play to the screen and file name. The play by play  
lines would come from the program or a seperate text file based on how  
well the attack or dodge was executed.

---

<div class="post-metadata">

**Author:** ![wizofozz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/d78d45/32.png) [@wizofozz](https://www.ruby-forum.com/u/wizofozz)\
**Post date:** [April 12, 2010, 12:34am UTC](https://www.ruby-forum.com/t/text-fighting-gladitorial-sim/186688/4 "2010-04-12T00:34:52Z")

</div>

Garret Dupont wrote:

> I am attempting to create a gladitorial fighting sim. It will be able to  
> pit two players (computer controlled) and based on stats, weapons, armor  
> and some randomness will attack, deal damage, dodge and counter attack.  
> What would be the easiest way to go about doing this. The outcome will  
> be in a play-by-play format, printed on screen and also saved as a text  
> document. The players stats will be saved and would earn experience  
> based on the difficulty of the battle. I appreciate any response.
> 
> Very Respectfully,  
> Wiz

You’ll want to use .rand for a certain number and add it as an attack  
modifyer… basically adding it in, then subtracting it when you don’t  
need it. Or just use a variable for base stats.

Printing on screen is easy,though if it’s like R-warriorwith it’s  
showing positions on screen you’ll want to use print and \n for a new  
line.

Though for a text doc, you might want to use a Yaml doc and just read it  
with notepad or WordPad.

---

<div class="post-metadata">

**Author:** ![wizofozz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/d78d45/32.png) [@wizofozz](https://www.ruby-forum.com/u/wizofozz)\
**Post date:** [April 12, 2010, 2:43pm UTC](https://www.ruby-forum.com/t/text-fighting-gladitorial-sim/186688/5 "2010-04-12T14:43:56Z")

</div>

Garret Dupont wrote:

> I am attempting to create a gladitorial fighting sim. It will be able to  
> pit two players (computer controlled) and based on stats, weapons, armor  
> and some randomness will attack, deal damage, dodge and counter attack.  
> What would be the easiest way to go about doing this. The outcome will  
> be in a play-by-play format, printed on screen and also saved as a text  
> document. The players stats will be saved and would earn experience  
> based on the difficulty of the battle. I appreciate any response.
> 
> Very Respectfully,  
> Wiz

Sounds like you should take a look at the seventh Ruby P.ming  
Challenge For Newbies:

> **[Learn How to Blog and Build Websites for Profit!](https://heyblogging.com)**
>
> Ready to take your blogging skills to the next level? Learn how to build a website that generates income and sets you up for success.

The submitted server and winning codes may help you.
