Contest Code

  Home arrow Contest Code arrow Risk map output
CONTEST CODE

Risk map output
By: Codewalkers
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 1
    2003-07-03

    Table of Contents:

     
     

    SEARCH CODEWALKERS

    Modification of gatopeich's map HTML

    By : webhappy

    <?php
    function drawMap ( $landowner, $nosoldiers )
    {
    $mapOutline='<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>
    <meta http-equiv="content-type"
    content="text/html; charset=ISO-8859-1">
    <title>Risk Table Map</title>
    <style type="text/css">
    td { text-align: left; vertical-align: top;}
    .N_America { background-color: #ffff22;}
    .S_America { background-color: #2255ff;}
    .Europe { background-color: #ff22ff;}
    .Asia { background-color: #55ff55;}
    .Africa { background-color: #aa5533;}
    .Oceania { background-color: #ffa000;}
    .bridge { background-color: #a0a0a0;}
    .A { background-color: #ff0000;}
    .B { background-color: #00ff00;}
    .C { background-color: #0000ff;}
    .D { background-color: #ffff00;}
    .X { background-color: #808080;}
    </style>
    </head>
    <body>
    <h1>Risk Map</h1>
    <table cellpadding="1" cellspacing="1" border="1" width="100%" bgcolor="#ddddff">
    <tr>
    <td>.</td><td>.</td><td>.</td><td>.</td><td>.</td>
    <td class="N_America" rowspan="3" colspan="3">2<table align=center class="'.$landowner[2].'"><td>'.$nosoldiers[2].'</td></table>
    </td>
    <td>.</td><td>.</td><td>.</td><td>.</td><td>.</td><td>.</td><td>.</td><td>.</td><td>.</td>
    <td class="Asia" rowspan="4" colspan="1">20<table align=center class="'.$landowner[20].'"><td>'.$nosoldiers[20].'</td></table>
    </td>
    <td class="Asia">21<table align=center class="'.$landowner[21].'"><td>'.$nosoldiers[21].'</td></table>
    </td>
    <td class="Asia" rowspan="3" colspan="1">22<table align=center class="'.$landowner[22].'"><td>'.$nosoldiers[22].'</td></table>
    </td>
    <td>.</td>
    </tr>
    <tr>
    <td>.</td><td>.</td><td>.</td>
    <td class="N_America" rowspan="2" colspan="2">1<table align=center class="'.$landowner[1].'"><td>'.$nosoldiers[1].'</td></table></td>
    <td>.</td><td>.</td><td>.</td><td>.</td><td>.</td><td>.</td><td>.</td>
    <td class="Asia" rowspan="4" colspan="2">19<table align=center class="'.$landowner[19].'"><td>'.$nosoldiers[19].'</td></table></td>
    <td class="Asia">23<table align=center class="'.$landowner[23].'"><td>'.$nosoldiers[23].'</td></table></td>
    <td class="bridge">-</td>
    </tr>
    <tr>
    <td class="bridge">-</td>
    <td class="N_America" rowspan="2" colspan="2">0<table align=center class="'.$landowner[0].'"><td>'.$nosoldiers[0].'</td></table></td>
    <td class="bridge" rowspan="2" colspan="1">-</td>
    <td>.</td>
    <td>.</td>
    <td class="Europe" rowspan="3" colspan="2">13<table align=center class="'.$landowner[13].'"><td>'.$nosoldiers[13].'</td></table></td>
    <td class="Europe" rowspan="4" colspan="2">14<table align=center class="'.$landowner[14].'"><td>'.$nosoldiers[14].'</td></table></td>
    <td class="Asia" rowspan="2" colspan="1">24<table align=center class="'.$landowner[24].'"><td>'.$nosoldiers[24].'</td></table></td>
    <td>.</td>
    </tr>
    <tr>
    <td>.</td>
    <td class="N_America" rowspan="3" colspan="1">3<table align=center class="'.$landowner[3].'"><td>'.$nosoldiers[3].'</td></table></td>
    <td class="N_America" rowspan="3" colspan="4">4<table align=center class="'.$landowner[4].'"><td>'.$nosoldiers[4].'</td></table></td>
    <td class="Europe">12<table align=center class="'.$landowner[12].'"><td>'.$nosoldiers[12].'</td></table></td>
    <td class="bridge">-</td>
    <td class="Asia">25<table align=center class="'.$landowner[25].'"><td>'.$nosoldiers[25].'</td></table></td>
    <td>.</td>
    </tr>
    <tr>
    <td>.</td><td>.</td><td>.</td>
    <td class="bridge" rowspan="1" colspan="2">-</td>
    <td class="Europe" rowspan="2" colspan="1">15<table align=center class="'.$landowner[15].'"><td>'.$nosoldiers[15].'</td></table></td>
    <td class="Asia" rowspan="3" colspan="2">29<table align=center class="'.$landowner[29].'"><td>'.$nosoldiers[29].'</td></table></td>
    <td>.</td><td>.</td>
    </tr>
    <tr>
    <td>.</td><td>.</td><td>.</td><td>.</td><td>.</td>
    <td class="Europe" rowspan="1" colspan="2">17<table align=center class="'.$landowner[17].'"><td>'.$nosoldiers[17].'</td></table></td>
    <td class="Asia" colspan="2" rowspan="1">27<table align=center class="'.$landowner[27].'"><td>'.$nosoldiers[27].'</td></table></td>
    <td>.</td><td>.</td>
    </tr>
    <tr>
    <td>.</td><td>.</td><td>.</td>
    <td class="N_America" rowspan="2" colspan="2">5<table align=center class="'.$landowner[5].'"><td>'.$nosoldiers[5].'</td></table></td>
    <td class="N_America" rowspan="2" colspan="2">6<table align=center class="'.$landowner[6].'"><td>'.$nosoldiers[6].'</td></table></td>
    <td>.</td><td>.</td><td>.</td>
    <td class="Europe" rowspan="2" colspan="1">16<table align=center class="'.$landowner[16].'"><td>'.$nosoldiers[16].'</td></table></td>
    <td class="Europe" rowspan="1" colspan="3">18<table align=center class="'.$landowner[18].'"><td>'.$nosoldiers[18].'</td></table></td>
    <td class="Asia" rowspan="4" colspan="2">26<table align=center class="'.$landowner[26].'"><td>'.$nosoldiers[26].'</td></table></td>
    <td class="Asia" rowspan="5" colspan="1">28<table align=center class="'.$landowner[28].'"><td>'.$nosoldiers[28].'</td></table></td>
    <td>.</td><td>.</td>
    </tr>
    <tr>
    <td>.</td><td>.</td><td>.</td><td>.</td><td>.</td><td>.</td><td>.</td>
    <td class="bridge">-</td>
    <td>.</td>
    <td class="Asia" rowspan="3" colspan="1">30<table align=center class="'.$landowner[30].'"><td>'.$nosoldiers[30].'</td></table></td>
    <td>.</td><td>.</td><td>.</td>
    </tr>
    <tr>
    <td>.</td><td>.</td><td>.</td><td>.</td>
    <td class="N_America" rowspan="2" colspan="2">7<table align=center class="'.$landowner[7].'"><td>'.$nosoldiers[7].'</td></table></td>
    <td>.</td><td>.</td><td>.</td><td>.</td>
    <td class="Africa" rowspan="4" colspan="1">31<table align=center class="'.$landowner[31].'"><td>'.$nosoldiers[31].'</td></table></td>
    <td class="Africa" rowspan="1" colspan="3">32<table align=center class="'.$landowner[32].'"><td>'.$nosoldiers[32].'</td></table></td>
    <td>.</td><td>.</td><td>.</td>
    </tr>
    <tr>
    <td>.</td><td>.</td><td>.</td><td>.</td><td>.</td><td>.</td><td>.</td><td>.</td>
    <td class="Africa" rowspan="2" colspan="3">33<table align=center class="'.$landowner[33].'"><td>'.$nosoldiers[33].'</td></table></td>
    <td class="bridge">-</td>
    <td>.</td><td>.</td>
    </tr>
    <tr>
    <td>.</td><td>.</td><td>.</td><td>.</td>
    <td class="S_America" rowspan="1" colspan="3">8<table align=center class="'.$landowner[8].'"><td>'.$nosoldiers[8].'</td></table></td>
    <td>.</td><td>.</td><td>.</td><td>.</td><td>.</td><td>.</td>
    <td class="Oceania">36<table align=center class="'.$landowner[36].'"><td>'.$nosoldiers[36].'</td></table></td>
    <td class="Oceania">37<table align=center class="'.$landowner[37].'"><td>'.$nosoldiers[37].'</td></table></td>
    <td>.</td>
    </tr>
    <tr>
    <td>.</td><td>.</td><td>.</td><td>.</td>
    <td class="S_America" rowspan="2" colspan="2">10<table align=center class="'.$landowner[10].'"><td>'.$nosoldiers[10].'</td></table></td>
    <td class="S_America" rowspan="3" colspan="3">9<table align=center class="'.$landowner[9].'"><td>'.$nosoldiers[9].'</td></table></td>
    <td class="bridge">-</td>
    <td class="Africa" rowspan="2" colspan="1">34<table align=center class="'.$landowner[34].'"><td>'.$nosoldiers[34].'</td></table></td>
    <td class="Africa" rowspan="3" colspan="2">35<table align=center class="'.$landowner[35].'"><td>'.$nosoldiers[35].'</td></table></td>
    <td>.</td><td>.</td><td>.</td><td>.</td>
    <td class="Oceania" rowspan="2" colspan="1">38<table align=center class="'.$landowner[38].'"><td>'.$nosoldiers[38].'</td></table></td>
    <td class="Oceania" rowspan="2" colspan="1">39<table align=center class="'.$landowner[39].'"><td>'.$nosoldiers[39].'</td></table></td>
    <td>.</td>
    </tr>
    <tr>
    <td>.</td><td>.</td><td>.</td><td>.</td><td>.</td><td>.</td><td>.</td><td>.</td>
    <td>.</td><td>.</td><td>.</td>
    </tr>
    <tr>
    <td>.</td><td>.</td><td>.</td><td>.</td><td>.</td>
    <td class="S_America" rowspan="3" colspan="1">11<table align=center class="'.$landowner[11].'"><td>'.$nosoldiers[11].'</td></table></td>
    <td>.</td><td>.</td><td>.</td><td>.</td><td>.</td><td>.</td><td>.</td><td>.</td>
    <td>.</td><td>.</td>
    </tr>
    <tr>
    <td>.</td><td>.</td><td>.</td><td>.</td><td>.</td><td>.</td><td>.</td><td>.</td>
    <td>.</td><td>.</td><td>.</td><td>.</td><td>.</td><td>.</td><td>.</td><td>.</td>
    <td>.</td><td>.</td><td>.</td><td>.</td>
    </tr>
    <tr>
    <td>.</td><td>.</td><td>.</td><td>.</td><td>.</td><td>.</td><td>.</td><td>.</td>
    <td>.</td><td>.</td><td>.</td><td>.</td><td>.</td><td>.</td><td>.</td><td>.</td>
    <td>.</td><td>.</td><td>.</td><td>.</td>
    </tr>
    </table>
    <p>made by <a href="mailto:ferrin@arrakis.es">gatopeich</a>
    for <a href="http://www.codewalkers.com">Codewalkers</a>\' PHP \'Risk\' contest.</p>


    ';
    echo $mapOutline;
    }
    ?>
    DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

    More Contest Code Articles
    More By Codewalkers

    blog comments powered by Disqus

    CONTEST CODE ARTICLES

    - Visual Map Editor And Generator
    - Corridors map generator
    - PHP-JAVA Class Code Generator
    - Risk - print_map($game, $some_array_of_size_...
    - Risk: The Original ShowGame/Map
    - Showgame2
    - Risk map output
    - CTF-Judge, better "auto" controls
    - Capture The Flag -- The JUDGE

    Developer Shed Affiliates

     



    © 2003-2019 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap