Search
Search titles only
By:
Search titles only
By:
Log in
Register
Search
Search titles only
By:
Search titles only
By:
Menu
Install the app
Install
Forums
New posts
All threads
Latest threads
New posts
Trending threads
Trending
Search forums
What's new
New posts
New ads
New profile posts
Latest activity
Free Ads
Latest reviews
Search ads
Members
Current visitors
New profile posts
Search profile posts
Contact us
Latest ads
Colombo
Red Hat Certified System Administrator (RHCSA) - RHEL 10
Sanjeewani95
Updated:
Friday at 7:43 PM
NURSING , CAREGIVER , HOTEL & BEAUTY COURSES
IVA Para Medical Campus
Updated:
Thursday at 9:24 AM
Handmade Character Soft Toys Peppa Pig Family
anil1961
Updated:
Wednesday at 9:58 PM
Ad icon
Video Content Creator
pramukag
Updated:
Jun 28, 2026
Ad icon
QA Engineer Intern
pramukag
Updated:
Jun 28, 2026
Electronics
Vehicles
Property
Search
Reply to thread
Forums
General
Education
Thread for Programming and Realeted Topics
Get the App
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Message
<blockquote data-quote="madurax86" data-source="post: 5977118" data-attributes="member: 1293"><p>Mine takes 17.625 seconds when there are 6 digits <img src="/styles/default/xenforo/smilies/default/D.gif" class="smilie" loading="lazy" alt=":D" title="Big grin :D" data-shortname=":D" /> lol it should be slow man! its not taking time to fill the memory its for the video buffer(console display) anyway good that you made the algorithm ! <img src="/styles/default/xenforo/smilies/default/D.gif" class="smilie" loading="lazy" alt=":D" title="Big grin :D" data-shortname=":D" /></p><p>So far i don't handle duplicates <img src="/styles/default/xenforo/smilies/default/P.gif" class="smilie" loading="lazy" alt=":P" title=":P :P" data-shortname=":P" />, I'm trying to make an algorithm for non repeating digits (පුනරාවර්තනය රහිත) we'll see! <img src="/styles/default/xenforo/smilies/default/P.gif" class="smilie" loading="lazy" alt=":P" title=":P :P" data-shortname=":P" /> i'm still thinking the algo will most probably be made tomorrow </p><p>heres the pascal/delphi procedure</p><p>[code]</p><p>const ELEMENTS = 5; //element count -1</p><p>const PLACES = 5; //place count -1</p><p></p><p>var</p><p> lst:array [0..ELEMENTS] of integer;</p><p> nlst:array of array [0..PLACES] of integer;</p><p></p><p>procedure SetListWR();</p><p>var i,j,LEN,k:integer;</p><p>begin</p><p> LEN:=Pow(ELEMENTS+1,PLACES+1);</p><p> SetLength(nlst,LEN);</p><p> k:=0;</p><p> for j:=0 to PLACES do</p><p> for i:=0 to LEN-1 do</p><p> begin</p><p> if ((i) mod pow(ELEMENTS+1,j)) = 0 then</p><p> begin</p><p> if (k=ELEMENTS) then</p><p> k:=0</p><p> else</p><p> k:=k+1;</p><p> end;</p><p> nlst[i,j]:=lst[k];</p><p> end;</p><p> k:=0 ;</p><p> for j:=0 to LEN -1 do</p><p> begin</p><p> for i:=0 to PLACES do</p><p> begin</p><p> write(nlst[j,i]);</p><p> end;</p><p> writeln('');</p><p> k:=k+1;</p><p> end;</p><p> Writeln('Number of permutations : ',k);</p><p>end;</p><p></p><p>[/code]</p></blockquote><p></p>
[QUOTE="madurax86, post: 5977118, member: 1293"] Mine takes 17.625 seconds when there are 6 digits :D lol it should be slow man! its not taking time to fill the memory its for the video buffer(console display) anyway good that you made the algorithm ! :D So far i don't handle duplicates :P, I'm trying to make an algorithm for non repeating digits (පුනරාවර්තනය රහිත) we'll see! :P i'm still thinking the algo will most probably be made tomorrow heres the pascal/delphi procedure [code] const ELEMENTS = 5; //element count -1 const PLACES = 5; //place count -1 var lst:array [0..ELEMENTS] of integer; nlst:array of array [0..PLACES] of integer; procedure SetListWR(); var i,j,LEN,k:integer; begin LEN:=Pow(ELEMENTS+1,PLACES+1); SetLength(nlst,LEN); k:=0; for j:=0 to PLACES do for i:=0 to LEN-1 do begin if ((i) mod pow(ELEMENTS+1,j)) = 0 then begin if (k=ELEMENTS) then k:=0 else k:=k+1; end; nlst[i,j]:=lst[k]; end; k:=0 ; for j:=0 to LEN -1 do begin for i:=0 to PLACES do begin write(nlst[j,i]); end; writeln(''); k:=k+1; end; Writeln('Number of permutations : ',k); end; [/code] [/QUOTE]
Insert quotes…
Verification
Winadiyakata thappara keeyak tibeda?
Post reply
Top
Bottom