Eugene van der Pijll schreef op 17 februari 2002:
> 151:
>
> sub f{@s[$x,$y]=@s[($y+=$s[$x])%=@s,$x];
> $s[$x++]+$s[$y]}@k=pop=~/../g;$y+=hex$k[
> $x%@k],f for@s=0..255;$x=1;$y=0;$x%=@s,p
> rint$_^chr$s[f()%@s]for<>=~/./g
I haven't got a clue about RC4, but inspecting Eugene's
masterpiece, can yo
On 18 Feb 02, at 10:46, [EMAIL PROTECTED] wrote:
> Philip Newton wrote:
> > Well, existing compilers tend to be slow to implement new
> > standards such as C99
> >
> > So for my purposes, "standard C" is "ANSI C" i.e. "K&R 2nd ed.". YMMV.
>
> Interestingly, in this particular case, many vend
On Sun, Feb 17, 2002 at 12:02:49PM -0500, Bill -OSX- Jones wrote:
>
> >Vicki writes:
> >
> >> if (...) {
> >>my @item_parts = split(/\n/, $item);
> >>printf ORDER ("\n%4d %-50s %3.2f %3.2f\n",
> >> $quantity, $item_par
Philip Newton wrote:
> Well, existing compilers tend to be slow to implement new
> standards such as C99
>
> So for my purposes, "standard C" is "ANSI C" i.e. "K&R 2nd ed.". YMMV.
Interestingly, in this particular case, many vendors are very
*quick* to implement, often implementing before it
[EMAIL PROTECTED] ("Philip Newton") writes:
>On 17 Feb 02, at 11:05, Patrik Grip-Jansson wrote:
>> No, you're wrong there. Using '//' as a comment is a part of the C
>> standard. Have a look at a recent version, for example the one at;
>> http://www.cl.cam.ac.uk/~mgk25/volatile/ISO-C-FDIS.1999-0
On Sun, 17 Feb 2002 11:55:27 +0100, [EMAIL PROTECTED] (Peter Makholm)
wrote:
> Philip Newton <[EMAIL PROTECTED]> writes:
>
> > Well, not really C since you rely on '//' introducing a
> > comment-to-end-of-line.
>
> I cannot find the C99 standard. But it looks like '//' was introduced
> as comme
On Sun, 17 Feb 2002 12:02:43 -0800, [EMAIL PROTECTED] wrote:
> On Sun, Feb 17, 2002 at 07:35:24AM +0100, Philip Newton wrote:
> > On Sun, 17 Feb 2002 09:42:55 +1100, [EMAIL PROTECTED] (Andrew Savige)
> > wrote:
> >
> > > you have a choice of 3 different languages (Perl, C or C++). ^.^
> >
> > W
On Sun, Feb 17, 2002 at 07:35:24AM +0100, Philip Newton wrote:
> On Sun, 17 Feb 2002 09:42:55 +1100, [EMAIL PROTECTED] (Andrew Savige)
> wrote:
>
> > you have a choice of 3 different languages (Perl, C or C++). ^.^
>
> Well, not really C since you rely on '//' introducing a
> comment-to-end-of-l
> "VB" == Vicki Brown <[EMAIL PROTECTED]> writes:
>> my $p_item = ( ... ) ? (split( /\n/, $item ))[0] : $item ;
>> printf ORDER ("\n%4d %-50s %3.2f %3.2f\n",
>> $quantity, $p_item, $price, $ext);
VB> You realize, don't you, that I didn't post the whole script...?
probably, b
At 14:04 -0500 2/17/02, Uri Guttman wrote:
>another reason to write better perl code. the two printf's are so
>similar that they should be reduced to one and only the 2nd arg needs to
>be dealt with.
>
>
> my $p_item = ( ... ) ? (split( /\n/, $item ))[0] : $item ;
> printf ORDER ("\n%4
At 11:40 -0500 2/17/02, Ala Qumsieh wrote:
> } else {
> printf ORDER ("\n%4d %-50s %3.2f %3.2f\n",
> } $quantity, $item, $price, $ext);
Another reason to use Emacs :)
Ptooie :)~
--
- Vicki
Vicki Brown ZZZ
> "AQ" == Ala Qumsieh <[EMAIL PROTECTED]> writes:
AQ> Vicki writes:
> if (...) {
> my @item_parts = split(/\n/, $item);
> printf ORDER ("\n%4d %-50s %3.2f %3.2f\n",
> $quantity, $item_parts[0], $price, $ext);
> } else {
> printf ORDER ("\n%4d %-50
On 17 Feb 02, at 11:05, Patrik Grip-Jansson wrote:
> On Sun, 17 Feb 2002, Philip Newton wrote:
>
> > Well, not really C since you rely on '//' introducing a
> > comment-to-end-of-line. That's a C++-ism which some C compilers support
> > but which isn't part of the C standard.
>
> No, you're wro
Actually, I am really wondering why the syntax check doesn't feel
it was an error...
> printf ORDER ("\n%4d %-50s %3.2f %3.2f\n",
>} $quantity, $item, $price, $ext);
>
Aren't the
$quantity, $item, $price, $ext);
somehow orphaned after the brace?
_Sx
:| :} OK, so to put the others out of their (possible) misery:
> Vicki writes:
>
>> if (...) {
>> my @item_parts = split(/\n/, $item);
>> printf ORDER ("\n%4d %-50s %3.2f %3.2f\n",
>>$quantity, $item_parts[0], $pr
Vicki writes:
> if (...) {
> my @item_parts = split(/\n/, $item);
> printf ORDER ("\n%4d %-50s %3.2f %3.2f\n",
>$quantity, $item_parts[0], $price, $ext);
> } else {
> printf ORDER ("\n%
Rocco Caputo schreef op 16 februari 2002:
> I can't seem to get it below 160 characters. This is split
> arbitrarily at 40 characters; it will not work until joined.
>
> sub f{@s[$x,$y]=@s[($y+=$s[$x])%=@s,$x];
> $s[$x]+$s[$y]}@k=pop=~/../g;$y+=hex$k[$x
> %@k],f,$x++for@s=0..255;$x=$y=0;$x++,$x%
On Sat, 16 Feb 2002 12:01:21 -0800, Samy Kamkar wrote:
>
> It's RC4, so far in 182 bytes, accepts a hex key (e.g., a0b1c2) in
> $ARGV[0] and reads input from <>:
> sub
> f{@s[$x,$y]=@s[$y,$x]}@k=map{hex}pop=~/../g;$y=($y+$k[$_%@k]+$s[$x=$_])%256,f
> for@t=@s=0..255;$x=$y=0;$x++,$y+=$s[$x%=256]
Philip Newton <[EMAIL PROTECTED]> writes:
> Well, not really C since you rely on '//' introducing a
> comment-to-end-of-line.
I cannot find the C99 standard. But it looks like '//' was introduced
as comment-to-end-of-line in ISO 9899-1999 (aka. C99). So only if you
see K&R as the One True Author
Samy Kamkar wrote:
>
> Hi everyone!
Hello,
> Uri just pointed me out to this list today and I'm glad he did :)
>
> Well, I'd like to know if any of you are able to shorten this, I spent a
> few minutes last night and this morning shortening it to 182 bytes and
> I'm not sure what else can be d
On Sun, 17 Feb 2002, Philip Newton wrote:
> Well, not really C since you rely on '//' introducing a
> comment-to-end-of-line. That's a C++-ism which some C compilers support
> but which isn't part of the C standard.
No, you're wrong there. Using '//' as a comment is a part of the C
standard. Hav
On Sun, 17 Feb 2002, Dave Hoover <[EMAIL PROTECTED]> wrote,
> Vicki wrote:
> >It took me a while to find the problem... when I did I was somewhat amused
> >
> > --- Begin Forward ---
> >
> >
> > if (...) {
> >my @item_parts = split(/\n/, $item);
> >prin
Vicki wrote:
>It took me a while to find the problem... when I did I was somewhat amused
>
> --- Begin Forward ---
>
>
> if (...) {
>my @item_parts = split(/\n/, $item);
>printf ORDER ("\n%4d %-50s %3.2f %3.2f\n",
> $qu
23 matches
Mail list logo