Armenian Knowledge Base  

Go Back   Armenian Knowledge Base > Technical sections > Languages, Compilers, Interpreters > Algorithms
Register

Reply
 
LinkBack Thread Tools
Old 14.06.2002, 06:07   #1
Школьник
 
Join Date: 04 2002
Location: Vanadzor
Posts: 227
Downloads: 0
Uploads: 0
Reputation: 0 | 0
Post Array shuffleing algorithm

hi,

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

$str = "EDFGn,./[email protected]&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 [email protected] xarni, stana mek ayl masiv, nuyn andamnerov, tarber indexnerov.

[email protected] petk a nenc ashxati vor amen angam nuy [email protected] vorpes parametr stanaluc, nuyn dzevov sarki [email protected], aysinkn aranc patahakanutun ogragorcelu.

xndrum em grek vonc ek patkeracnum es xndri [email protected]

naxapes shnorhakalutyun.
Reply With Quote
Old 14.06.2002, 10:04   #2
Младенец
 
Join Date: 04 2002
Location: Yerevan
Posts: 59
Downloads: 0
Uploads: 0
Reputation: 0 | 0
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
Reply With Quote
Old 14.06.2002, 14:52   #3
Дошкольник
 
Dark Abyss of Yerevan's Avatar
 
Join Date: 01 2002
Location: hell
Posts: 124
Downloads: 0
Uploads: 0
Reputation: 0 | 0
Post

Mek ayl tarberak - sort es anum [email protected] heto N angam kirarum es next_permutation i
predicate [email protected] Vorpes predicate ogtagorcum es less or equal, vor hnaravorutyun
lini havasar elementner ogtagorcel.

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

P.S. 2HR: Ete [email protected] hamarenq xarnelu tarberak, apa klini N!.
__________________
[x]-=-[ ]-=-[x]
Reply With Quote
Old 14.06.2002, 15:57   #4
Школьник
 
Join Date: 04 2002
Location: Vanadzor
Posts: 227
Downloads: 0
Uploads: 0
Reputation: 0 | 0
Post

nax shnorhakalutyun tarberakneri hamar

indz nenc dzev a petk vor, nuyn tvi depkum nuyn dzevi xarni [email protected], u massivi andamner-i kanakn u [email protected] chpoxven. u het [email protected] petk chi.

isk vor 2 tarber tveri depdum nuyn [email protected] stana da normal a.

2HR
et shift anelu [email protected] es el em mtacel, bayc vsyo taki, shat a primitiv.
Reply With Quote
Old 15.06.2002, 05:10   #5
Академик
 
greka's Avatar
 
Join Date: 09 2001
Location: inside myself
Posts: 5,369
Downloads: 0
Uploads: 0
Reputation: 18 | 5
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
__________________
И повешенные могут качаться в неположенную сторону. /С.Е.Лец/
Reply With Quote
Old 16.06.2002, 19:43   #6
Школьник
 
Join Date: 04 2002
Location: Vanadzor
Posts: 227
Downloads: 0
Uploads: 0
Reputation: 0 | 0
Post

thanks alot !
Reply With Quote
Sponsored Links
Reply

Thread Tools


На правах рекламы:
реклама

All times are GMT. The time now is 08:26.


Powered by vBulletin® Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.