joey
Member
My code also won't put two of the same characters in a row. So it won't print R then R. It does checks for that!
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
print+('R','U')[$_&1],('','\'','2')[int rand3],' 'for(0..24);
$><<(0..24).map{|x|%w(R U)[x&1]+"#{%w(' 2)[rand 2]} "}
print+($_&1?R:U).qw(' 2)[rand 3]for 0..24
24.times{|x|$><<%w(R U)[x&1]<<%w(' 2)[rand 3]}
I very rarely use Java. Although my application of programming only extends to programming competitions now, I almost always prefer C++ over it.Originally posted by dChan@May 14 2007, 05:32 PM
Which is easier to learn C++ or Java? And do they have a specific area of interest(one is better for games, other is better for application type stuff?).
Easier to learn? Depends. Some people say C++ is quite hard to start out with; I disagree. I started out with C++ and didn't have much trouble.Originally posted by dChan@May 14 2007, 05:32 PM
Which is easier to learn C++ or Java? And do they have a specific area of interest(one is better for games, other is better for application type stuff?).
I actually was going to learn C/C++ a while back because I wanted to code for the PSP(there's a huge hacker base there, just check pspupdates.qj.net). So I would think that C is better for me to learn.
<?
$end = array(' ', '2 ', '\' ');
for ($i=0; $i<25; $i++)
{
($i%2 == 0) ? $next = "R" : $next = "U";
$next .= $end[rand(0,2)];
echo $next;
}
?>
<?
$end = array(' ', '2 ', '\' ');
for ($i=0; $i<25; $i++)
{echo ($i%2 == 0) ? "R" : "U";
echo $end[rand(0,2)];}
?>