Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
pike
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pikelang
pike
Commits
a829464b
Commit
a829464b
authored
27 years ago
by
Mirar (Pontus Hagland)
Browse files
Options
Downloads
Patches
Plain Diff
permute added
Rev: lib/modules/Array.pmod:1.17 Rev: lib/modules/Calendar.pmod/Swedish.pmod:1.11
parent
40b919e8
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/modules/Array.pmod
+17
-0
17 additions, 0 deletions
lib/modules/Array.pmod
lib/modules/Calendar.pmod/Swedish.pmod
+4
-8
4 additions, 8 deletions
lib/modules/Calendar.pmod/Swedish.pmod
with
21 additions
and
8 deletions
lib/modules/Array.pmod
+
17
−
0
View file @
a829464b
...
@@ -74,6 +74,23 @@ array shuffle(array arr)
...
@@ -74,6 +74,23 @@ array shuffle(array arr)
return(arr);
return(arr);
}
}
array permute(array a,int n)
{
int q=sizeof(a);
int i;
a=a[..]; // copy
while (n && q)
{
int x=n%q;
n/=q;
q--;
if (x) [a[i],a[i+x]]=({ a[i+x],a[i] });
i++;
}
return a;
}
int search_array(mixed *arr, mixed fun, mixed ... args)
int search_array(mixed *arr, mixed fun, mixed ... args)
{
{
...
...
This diff is collapsed.
Click to expand it.
lib/modules/Calendar.pmod/Swedish.pmod
+
4
−
8
View file @
a829464b
inherit Calendar.ISO;
inherit Calendar.ISO
:ISO
;
void create()
void create()
{
{
...
@@ -11,13 +11,9 @@ void create()
...
@@ -11,13 +11,9 @@ void create()
"fredag","lrdag","sndag"});
"fredag","lrdag","sndag"});
}
}
constant ISO_Week=::Week;
constant ISO_Year=::Year;
constant ISO_Day=::Day;
class Week
class Week
{
{
inherit ISO
_
Week;
inherit ISO
::
Week;
string name()
string name()
{
{
...
@@ -27,7 +23,7 @@ class Week
...
@@ -27,7 +23,7 @@ class Week
class Year
class Year
{
{
inherit ISO
_
Year;
inherit ISO
::
Year;
array(array(string)) _namedays;
array(array(string)) _namedays;
mapping(string:int) _nameday_lookup;
mapping(string:int) _nameday_lookup;
...
@@ -88,7 +84,7 @@ class Year
...
@@ -88,7 +84,7 @@ class Year
class Day
class Day
{
{
inherit ISO
_
Day;
inherit ISO
::
Day;
array(string) names()
array(string) names()
{
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment