updated
– old comments are deleted because i have improved my script. so far i haven’t seen any errors. feel free to test more
check out my new code button in the comments field.. it actually replaces my other “better handle <code>” hack – test it out in the comments area by click on the “code” button π and let me know how you like it. if it’s worthwhile to release it as a hack.
<?php
function add_magic_quotes($array) {
foreach ($array as $k => $v) {
if (is_array($v)) {
$array[$k] = add_magic_quotes($v);
} else {
$array[$k] = addslashes($v);
}
}
return $array;
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
</HEAD>
<BODY>
test
</BODY>
</HTML>
<p>testing the CODE: by LORIE.</p>
<p>leaving on a jet plane<br>
<b>don't know <span style="font-weight: 400">when I'll be back again</span></b></p>
let’s try some java π
import javax.swing.JOptionPane; // import class JOPtionPane
public class SimpleGame03
{
public static void main (String args[])
{
int num1, num2, org, sum, addnum, compwin = 0, userwin = 0, tries = 0, start, cont = 0;
String input_addnum;
Object[] options = {"START", "CANCEL"};
start = JOptionPane.showOptionDialog (null, "Game: Twenty One\nPlayers: Computer & User\nOverview: The Computer will deal 2 random numbers between 2-11.\nIf the sum of the two numbers is between 12-21 User wins;\nIf the sum is not, then User can choose the computer to deal\n1 or 2 more numbers.\nIf the new total is between 12-21 User wins, if not, the Computer wins\n\n Have Fun!", " INFORMATION",
JOptionPane.DEFAULT_OPTION, JOptionPane.WARNING_MESSAGE, null, options, options [0]);
while ((cont != 1) && (start == 0))
{
num1 = (int) (Math.random () * 9) + 2;
num2 = (int) (Math.random () * 9) + 2;
sum = num1 + num2;
if ((sum >= 18) && (sum <= 21))
userwin = userwin + 1;
else
{
compwin = compwin + 1;
org = sum;
if (sum < 18)
{
input_addnum = JOptionPane.showInputDialog (num1 + " + " + num2 + " = " + sum + "\nTo little, do you want to add 1, or 2 more numbers?");
addnum = Integer.parseInt (input_addnum);
if (addnum == 1)
{
num1 = (int) (Math.random () * 9) + 2;
sum = sum + num1;
if ((sum >= 18) && (sum <= 21))
{
userwin = userwin + 1;
JOptionPane.showMessageDialog (null, org + " + " + num1 + " = " + sum + "\nYou WIN!");
}
else
{
JOptionPane.showMessageDialog (null, org + " + " + num1 + " = " + sum + "\nYou LOSE!");
}
}
else
{
num1 = (int) (Math.random () * 9) + 2;
num2 = (int) (Math.random () * 9) + 2;
sum = sum + num1 + num2;
if ((sum >= 18) && (sum <= 21))
{
userwin = userwin + 1;
JOptionPane.showMessageDialog (null, org + " + " + num1 + " + " + num2 + " = " + sum + "\nYou WIN!");
}
else
{
JOptionPane.showMessageDialog (null, org + " + " + num1 + " + " + num2 + " = " + sum + "\nYou LOSE!");
}
}
}
}
cont = JOptionPane.showConfirmDialog (null, "Do you want to continue?", " CONTINUE?", JOptionPane.YES_NO_OPTION);
}
if (start == 0)
JOptionPane.showMessageDialog (null, "User wins: " + userwin + "\nComputer wins: " + compwin);
else
JOptionPane.showMessageDialog (null, " END OF PROGRAM", "PROGRAM TERMINATED", JOptionPane.INFORMATION_MESSAGE); // if program never ran
System.exit (0);
} // ends main class
}
err… my backslashes are missing :(( \
<p>\ single backslashes missing</p>
had to double them in order for one to show up
i attempted to fix it. try again will you?
c.println("\nLalalaal give me a space ");
ooOooo… converted the slash x)
yes it worked π
<?php
include("blah.php");
?>
<div style="border:1pt solid black; font-weight:bold; color:#fff;"></div>
<style>
<style type="text/css">
body {
background-color: #FFFFFF;
scrollbar-arrow-color: #000000;
scrollbar-track-color: white;
scrollbar-shadow-color: #F1BEF9;
scrollbar-face-color: #F1BEF9;
scrollbar-highlight-color: #F1BEF9;
scrollbar-darkshadow-color: #F1BEF9;
scrollbar-3dlight-color: #F1BEF9;
}
.left, .blogbody, table.footer, .standard, .leftmodulefontcolor, td, p {
font: normal 9pt Tahoma;
line-height: 10pt;
color: #000000;
letter-spacing: 0px;
text-align: justify;
}
</style>
<html>
<head>
<title>OMG</title>
</head>
<body>
<font style="text-transform: uppercase">DODO LINKED ME!! XD</font>
</body>
</html>
You rock Dodo π
Testing the threaded comments…
\
i have a question dodo π this new code hack… when you are posting code in an entry, will it too have a new textarea JUST to type in code? and will convert the slashes, and pointy brackets to the & – type code? π
What I want to know is how you were able to get the comment. gif as a link in the comment link. That has bedeviled me from Day One! Thanks!
Great site, BTW, surfed in here from Jenny’s “Adoption” link!