To register for an Internet.com membership to receive newsletters and white papers, use the Register button ABOVE.
To participate in the message forums BELOW, click here
PHPBuilder.com  
 

 

Go Back   PHPBuilder.com > PHP Help > Code Critique

Code Critique Having someone critique your code is always a great way to hone the skills. Stop in and post your code to see what your peers may have done differently.

Reply
 
Thread Tools Rate Thread Display Modes
Old 10-02-2003, 11:16 PM   #1
drawmack
Computers can do that?
 
drawmack's Avatar
 
Join Date: Apr 2003
Location: Pocono Mtns PA
Posts: 3,268
shuffler

before anyone takes just a cursory look at the attached code and says SHUFFLE DOES THAT let me assure you that shuffle does not do this. This uses a key array on the input array. This is actually an encryption algorithm because it moves stuff around based on the key.

Actually is it an algorith that's used to generate a key from a seed. The same seed will generate the same key so it can be used in encryption. I just learned about the algorithm today and thought it would be fun to implement. It is attached, let me know what you think.
Attached Files
File Type: zip shuffle.zip (972 Bytes, 88 views)
drawmack is offline   Reply With Quote
Old 10-04-2003, 01:34 PM   #2
drawmack
Computers can do that?
 
drawmack's Avatar
 
Join Date: Apr 2003
Location: Pocono Mtns PA
Posts: 3,268
no comments?
drawmack is offline   Reply With Quote
Old 10-04-2003, 01:55 PM   #3
Merve
black sheep with red wool
 
Merve's Avatar
 
Join Date: Jul 2003
Location: North of the 49th parallel
Posts: 2,579
Quote:
Originally posted by drawmack
no comments?
disguised bump?
__________________
"A proof is a proof. What kind of a proof? It's a proof. A proof is a proof. And when you have a good proof, it's because it's proven." -- Jean Chrétien

The Three C's
Merve is offline   Reply With Quote
Old 10-04-2003, 02:12 PM   #4
Moonglobe
Better fan than rebelo!
 
Moonglobe's Avatar
 
Join Date: Apr 2003
Location: brain://localhost:left-side
Posts: 2,381
no a blantant bump, but thats ok because he's not asking for help.

drawmack, i looked at your code earlier but that was on my other comp and i was going to saay something but it froze up on me loading the reply page..... andnow ive forgotten. sorry.
__________________
there's no place i can be, since i found serenity.
Moonglobe is offline   Reply With Quote
Old 10-04-2003, 02:40 PM   #5
drawmack
Computers can do that?
 
drawmack's Avatar
 
Join Date: Apr 2003
Location: Pocono Mtns PA
Posts: 3,268
Quote:
Originally posted by Merve
disguised bump?
it doesn't make much sense to bump something that's only fourth. I was curious, what people thought since they were not commenting.
drawmack is offline   Reply With Quote
Old 10-04-2003, 03:06 PM   #6
Moonglobe
Better fan than rebelo!
 
Moonglobe's Avatar
 
Join Date: Apr 2003
Location: brain://localhost:left-side
Posts: 2,381
ah yes, not i remember:

tabs suck.


other than that, well its interesting if a bit hard to follow. the shuffling part could use some more commenting, methinks.
__________________
there's no place i can be, since i found serenity.
Moonglobe is offline   Reply With Quote
Old 10-04-2003, 03:12 PM   #7
drawmack
Computers can do that?
 
drawmack's Avatar
 
Join Date: Apr 2003
Location: Pocono Mtns PA
Posts: 3,268
the shuffling actually happens in one line of code. I added comments to that line. I also replaced the tabs with spaces.

my editor does that for me, replacing spaces with tabs, but since it's a free editor I'm not going to complain.

anyway here is the updated code.
Attached Files
File Type: zip shuffle.zip (1.1 KB, 76 views)
drawmack is offline   Reply With Quote
Old 10-05-2003, 01:15 AM   #8
laserlight
PHP Witch
 
laserlight's Avatar
 
Join Date: Apr 2003
Location: Singapore
Posts: 12,388
what free editor *are* you using?
__________________
Use Bazaar for your version control system
Read the PHP Spellbook
Learn How To Ask Questions The Smart Way
laserlight is offline   Reply With Quote
Old 10-05-2003, 01:21 AM   #9
drawmack
Computers can do that?
 
drawmack's Avatar
 
Join Date: Apr 2003
Location: Pocono Mtns PA
Posts: 3,268
xhtml-kit
drawmack is offline   Reply With Quote
Old 10-05-2003, 01:30 AM   #10
LordShryku
kung foo code monkey
 
LordShryku's Avatar
 
Join Date: Aug 2002
Location: Occupational Hypnotherapy
Posts: 7,473
And where can we get this thing? Google only returns some seriously non-English sites
LordShryku is offline   Reply With Quote
Old 10-06-2003, 05:12 PM   #11
Weedpacket
Custom User Title™
 
Weedpacket's Avatar
 
Join Date: Aug 2002
Location: Rapid Offensive Unit "Foreign Object Damage"
Posts: 19,122
www.chami.com/htmlkit
__________________
On two occasions I have been asked [by Members of Parliament], "Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?" I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question.
Weedpacket is offline   Reply With Quote
Old 10-06-2003, 05:23 PM   #12
LordShryku
kung foo code monkey
 
LordShryku's Avatar
 
Join Date: Aug 2002
Location: Occupational Hypnotherapy
Posts: 7,473
Thankya....gonna hafta give it a shot...
LordShryku is offline   Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT -4. The time now is 04:24 PM.






Acceptable Use Policy

internet.comMediabistrojusttechjobs.comGraphics.com

WebMediaBrands Corporate Info


Advertise | Newsletters | Feedback | Submit News

Legal Notices | Licensing | Permissions | Privacy Policy


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.