Just found this one online:
#include <stdio.h>
typedef struct {
int ch;
int count;
} star_t;
int main(void) {
star_t foo[] = {
{46, 22}, {47, 1}, {194, 1}, {180, 1}, {194, 1}, {175, 1}, {47, 1}, {41, 1}, {'\n', 1},
{46, 20}, {44, 1}, {47, 1}, {194, 1}, {175, 1}, {46, 2}, {47, 1}, {'\n', 1},
{46, 19}, {47, 1}, {46, 4}, {47, 1}, {'\n', 1},
{46, 13}, {47, 1}, {194, 1}, {180, 1}, {194, 1}, {175, 1}, {47, 1}, {39, 1}, {46, 3}, {39, 1}, {47, 1}, {194, 1}, {180, 1}, {194, 1}, {175, 1}, {194, 1}, {175, 1}, {96, 1}, {194, 1}, {183, 1}, {194, 1}, {184, 1}, {'\n', 1},
{46, 10}, {47, 1}, {39, 1}, {47, 1}, {46, 3}, {47, 1}, {46, 4}, {47, 1}, {46, 7}, {47, 1}, {194, 1}, {168, 1}, {194, 1}, {175, 1}, {92, 1}, {'\n', 1},
{46, 8}, {40, 1}, {39, 1}, {40, 1}, {46, 3}, {194, 1}, {180, 1}, {46, 3}, {194, 1}, {180, 1}, {46, 4}, {32, 1}, {194, 1}, {175, 1}, {126, 1}, {47, 1}, {39, 1}, {46, 3}, {39, 1}, {41, 1}, {'\n', 1},
{46, 9}, {92, 1}, {46, 17}, {39, 1}, {46, 5}, {47, 1}, {'\n', 1},
{46, 10}, {39, 2}, {46, 3}, {92, 1}, {46, 10}, {32, 1}, {95, 1}, {46, 1}, {194, 1}, {183, 1}, {194, 1}, {180, 1}, {'\n', 1},
{46, 12}, {92, 1}, {46, 14}, {40, 1}, {'\n', 1},
{46, 14}, {92, 1}, {46, 13}, {92, 1}, {46, 1}, {32, 1}, {'\n', 1}
};
int i, j;
for (i = 0; i < sizeof(foo) / sizeof(foo[0]); i++) {
star_t bar = foo[i];
for (j = 0; j < bar.count; j++) {
printf("%c", (char )bar.ch);
}
}
return 0;
}
Discussions
-
-
It's not suppose to do anything other than list days. Something that could have been done like this:W3bbo said:I executed the PHP... it's just a list of days, clicking on a link doesn't actually do anything other than reload the page.
This is under PHP5 though. Does your script make use of any PHP4-specific behaviour?
$list = "";
for ($i = 0; $i < date('t"); $i++) {
$list .= "<a href='pointlessCode.php?day={$i}' title='Day {$i}'>Day {$i}</a>, ";
}
print $list;
As for any PHP4-Specific behaviour, not sure. I think all of the code is ambiguous. No PHP OO activity or anything. No usage of $_SESSION...I think it's all cross-compat with 4 and 5
Somebody actually wanted a solution over at DevShed. They wanted links for days 1 - n of the current month. This was a joke-solution (although a functional one) for their problem. I thought it was funny
I was mostly curious if anybody here had every done anything similar as a joke.
-
"Billiant" is sarcastic - the code here is less-than-brilliant...far less than brilliant.
I wrote the following up as a joke to a friend. Curious if you .NET guys have ever written your own jokes?
The following code prints a link for each day of the current month: Day 1, Day 2, etc. The links direct you to another page that can do something with the query string...Enjoy.
(Oh, and yes, this IS a joke - so no flaming
)
<?php
getDays();
function getDays() {
$day = array("1","2","3","4","5","6","7","8","9","10","11","12","13",
"14","15","16","17","18","19","20","21","22","23","24",
"25","26","27","28","29","30","31");
$trueDays = array();
$arrayLinks = array();
for($i = 0; $i < count($day); $i++) {
if ($i < date("t") && $i > 0) {
if (is_numeric($i)) {
$trueDays[] = ($day[$i] > 0) ? $day[$i] : 0 ;
}
}
}
if (is_array($trueDays) && 1 == 1) {
$dayString = implode(",",$trueDays);
}
if (strlen($dayString) > 0) {
foreach ($trueDays as $day) {
$arrayLinks[] = "<a href='getDays.php?day={$day}'>Day {$day}</a>";
}
}
print "<a href='getDays.php?day=1'>Day 1</a>, " . implode(", ",$arrayLinks);
}
?>
-
Turrican,turrican said:Yepp..
But hm... unless you need to use IE6, perhaps it is time to ditch the TABLE. The road was very hard for me, but I am very happy that I did ditch the TABLE now, no more mess! =)
I don't do table-based layouts if that is what you're suggesting. I'm strictly div-based with a strict doctype exclusive. The table in this thread (now 2 years ago) was for representing tabular data.
Jonathan
-
Ceiling kitteh is sad, because when this account (jsampsonpc) was inaccessible, I had to use my liveid. Now that I have this account back, I can't use my liveid, because it's associated to (jonathan sampson) account.
Can haz delete FROM users WHERE user_name = "jonathansampson"
-
...but the world ends in 2012...Did London take this into consideration when they decided to host the games?brian.shapiro said:London will have to do better in 2012, W3bbo

-
I don't recall ever experiencing this issue with anything but IE.stevo_ said:ScottWFB said:*snip*display: block usually works.. but if not, use floating.. its not just an IE thing either..
@ ScottWFB, no, I've found no solution. I haven't really noticed it lately though in IE7 - but that doesn't mean it won't creep up on me sometime in the future.
-
I invoke THREAD.RESURRECTION();!
It's been almost 2 years, and nobody has learned anything?
Let me be the first to start.
Last week, W3bbo helped me solve a problem relating to Storing Markup in Data-fields. He introduced me to Markdown, a great way to keep your content clean, and convert it to HTML upon displaying.
Now my database is getting cleaner and cleaner, and I even have my wife working on converting the rest of it, as a testimony to how easy it is to format your data with markdown - even my non-coding wife can do it.
Thanks W3bbo
-
figuerres wrote:Just read a bit about it and it sounds GREAT!
It is, completely. I used the PHP version, and it's nothing morethan calling the Markdown($source) function. It's so easy to use too. I am actually hiring my wife (who knows next to nothing about HTML/CSS) to come in and reformat the article database for me while I continue coding.