AKB Forums

Go Back   AKB Forums > Technical sections > Algorithms
Home Register Blogs FAQ Members List Calendar Downloads Arcade Mark Forums Read

Algorithms The source of algorithms for your project

Troubles when posting message? Click here! :: Проблемы с отправлением сообщения? Нажмите сюда!

Reply
 
LinkBack Thread Tools Display Modes
Old Jun 14, 2002, 05:07   #1
Школьник
 
Join Date: Apr 2002
Location: Vanadzor
Posts: 227
Rep Power: 7
Reputation: 10
Post Array shuffleing algorithm

hi,

senc mi xndir, unenk string, kareli a @ndunel vorpes masiv:

$str = "EDFGn,./~!@&HJoNM<>?qS#$%^uz0-pROtdm_biesT YUIQA3CwyKL:\"ZXVB[]afrghjkl;'xvc*()+|\\=98WP{}765421`";

mi hat funkcia a petk kam algoritm vor mi tiv @nduni vores parametr u et tvi himan vra es massiv@ xarni, stana mek ayl masiv, nuyn andamnerov, tarber indexnerov.

algoritm@ petk a nenc ashxati vor amen angam nuy tiv@ vorpes parametr stanaluc, nuyn dzevov sarki massiv@, aysinkn aranc patahakanutun ogragorcelu.

xndrum em grek vonc ek patkeracnum es xndri lucum@.

naxapes shnorhakalutyun.
strax. is offline   Reply With Quote Quote selected
Old Jun 14, 2002, 09:04   #2
Младенец
 
Join Date: Apr 2002
Location: Yerevan
Posts: 59
Rep Power: 0
Reputation: 10
Post

Nu amen inch kaxvac a te qez inchqan a petq xarnel ed masiv'.

Amenaparz dzeveric mek' hetevyaln a

Funkcian stanalov i tiv', uxxaki masivi andamneri indexner' i-ov shexum a . Aysinqn ete unes
A1 A2 A3
u funkcian stanum a 1 , A2' darnum a A1 , A3' darnum a A2 , isk A1' darnum a A3.
Bayc de es shat shat shat primitiv dzev a , ete qez aveli shat a petq xarnel , asa kmtacem.

U mi ban el , du uzum es vor nuyn tiv' stanalu depqum funkcian nuyn dzevov xarni masiv' , aysinqn konknret tvin hamapatsxani konkret xarnelu dzev , isk tuyaltrvum a vor nuyn xarnelu dzev' hamapatasxani tarber tveri ??, aysinqn orinak fukcian 4 ev 25 stanalu depqum nuyn dzevov a xarnum . Ete chi tuylatrvum , uremn petq a funkicaid poxancvox tveri iraric terber arjeqneri kanak' sahmanapakes , vorovhetev ete masivid erkarutyun' n a , ka xarnelu amenashat' n!-1 dzev.

Regards HR
__________________
http://hreg.livejournal.com
HR is offline   Reply With Quote Quote selected
Old Jun 14, 2002, 13:52   #3
Дошкольник
 
Dark Abyss of Yerevan's Avatar
 
Join Date: Jan 2002
Location: hell
Posts: 124
Rep Power: 7
Reputation: 10
Send a message via ICQ to Dark Abyss of Yerevan
Post

Mek ayl tarberak - sort es anum array@ heto N angam kirarum es next_permutation i
predicate version@. Vorpes predicate ogtagorcum es less or equal, vor hnaravorutyun
lini havasar elementner ogtagorcel.

Sagh harc@ nranuma te qez inch tipi kodavoruma petq. Ete petqa vor lini poxmiarjeq,
aysinqn ete stacac hajordakanutyunov u N ov du petqa karoghanas skzbnakan@
verakangnes, apa es algorithm@ chi lini. Senc ches kara verakangnes qani vor sort aneluc
hajordakanutyan skzbnakan structuran koruma.

P.S. 2HR: Ete chxarnel@ hamarenq xarnelu tarberak, apa klini N!.
__________________
[x]-=-[ ]-=-[x]
Dark Abyss of Yerevan is offline   Reply With Quote Quote selected
Old Jun 14, 2002, 14:57   #4
Школьник
 
Join Date: Apr 2002
Location: Vanadzor
Posts: 227
Rep Power: 7
Reputation: 10
Post

nax shnorhakalutyun tarberakneri hamar

indz nenc dzev a petk vor, nuyn tvi depkum nuyn dzevi xarni masiv@, u massivi andamner-i kanakn u arjekner@ chpoxven. u het verakangnel@ petk chi.

isk vor 2 tarber tveri depdum nuyn massiv@ stana da normal a.

2HR
et shift anelu gaghapar@ es el em mtacel, bayc vsyo taki, shat a primitiv.
strax. is offline   Reply With Quote Quote selected
Old Jun 15, 2002, 04:10   #5
Administrator
 
greka's Avatar
 
Join Date: Sep 2001
Location: @work
Posts: 5,337
Rep Power: 10
Reputation: 23
Send a message via ICQ to greka
Wink

Ispol'zuj pervye N simvolov kak kljuch (ili kajdyj nechetnyj simvol kak kljuch).

Kljuch ispol'zuj sledujsuhim obrazom:

1. generazija unikal'nogo (psevdo-unikal'nogo) chisla (na osnovanii ASCII-kodov simvolov) - tipa CRC libo summy vsex zaglavnyx bukv.

2. ispol'zovanie kljucha - v predelax tvoej fantazii mojesh' sovmeshat' operaciju XOR, bit-SWAPping, perestanovka pozicij simvolov po linejnoj (nelinejnoj) zavisimosti ot kakogo-to parametra kljucha - chislo dvoichnyx edinic, etc.

NOTE: ispolnenie punktov "1" i "2" - sovershenno proizvol'noe.
A ocherednost' punktov mejat' nel'zja .. )

Vopros o nadejnosti i slojnosti vzloma ne stavim - knijki po encrypting-u est' vezde.



b/r
__________________
И повешенные могут качаться в неположенную сторону. /С.Е.Лец/
greka is offline   Reply With Quote Quote selected
Old Jun 16, 2002, 18:43   #6
Школьник
 
Join Date: Apr 2002
Location: Vanadzor
Posts: 227
Rep Power: 7
Reputation: 10
Post

thanks alot !
strax. is offline   Reply With Quote Quote selected
Reply


Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 22:20.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
This board was founded on September 29, 2001
Powered by Viper Internet

Affordable Web Hosting | ParevNet

Buy text link