Datasets:
Update README.md
Browse files
README.md
CHANGED
@@ -39,7 +39,7 @@ license: cc-by-sa-4.0
|
|
39 |
|
40 |
### Dataset Summary
|
41 |
|
42 |
-
|
43 |
|
44 |
### Supported Tasks and Leaderboards
|
45 |
|
@@ -53,15 +53,74 @@ license: cc-by-sa-4.0
|
|
53 |
|
54 |
### Data Instances
|
55 |
|
56 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
57 |
|
58 |
### Data Fields
|
59 |
|
60 |
-
|
|
|
|
|
|
|
|
|
|
|
61 |
|
62 |
### Data Splits
|
63 |
|
64 |
-
|
65 |
|
66 |
## Dataset Creation
|
67 |
|
|
|
39 |
|
40 |
### Dataset Summary
|
41 |
|
42 |
+
> Rosetta Code is a programming chrestomathy site. The idea is to present solutions to the same task in as many different languages as possible, to demonstrate how languages are similar and different, and to aid a person with a grounding in one approach to a problem in learning another. Rosetta Code currently has 1,203 tasks, 389 draft tasks, and is aware of 883 languages, though we do not (and cannot) have solutions to every task in every language.
|
43 |
|
44 |
### Supported Tasks and Leaderboards
|
45 |
|
|
|
53 |
|
54 |
### Data Instances
|
55 |
|
56 |
+
First row:
|
57 |
+
```
|
58 |
+
{'task_url': 'http://rosettacode.org/wiki/Ascending_primes',
|
59 |
+
'task_name': 'Ascending primes',
|
60 |
+
'task_description': "Generate and show all primes with strictly ascending decimal digits.\n\nAside: Try solving without peeking at existing solutions. I had a weird idea for generating\na prime sieve faster, which needless to say didn't pan out. The solution may be p(r)etty trivial\nbut generating them quickly is at least mildly interesting.\nTip: filtering all 7,027,260 primes below 123,456,789 probably won't kill you, but there is\nat least one significantly better and much faster way, needing a mere 511 odd/prime tests.\n\n\n\nSee also\n OEIS:A052015 - Primes with distinct digits in ascending order\n\n\nRelated\n\nPrimes with digits in nondecreasing order (infinite series allowing duplicate digits, whereas this isn't and doesn't)\nPandigital prime (whereas this is the smallest, with gaps in the used digits being permitted)\n\n",
|
61 |
+
'language_url': '#ALGOL_68',
|
62 |
+
'language_name': 'ALGOL 68'}
|
63 |
+
```
|
64 |
+
Code:
|
65 |
+
```
|
66 |
+
BEGIN # find all primes with strictly increasing digits #
|
67 |
+
PR read "primes.incl.a68" PR # include prime utilities #
|
68 |
+
PR read "rows.incl.a68" PR # include array utilities #
|
69 |
+
[ 1 : 512 ]INT primes; # there will be at most 512 (2^9) primes #
|
70 |
+
INT p count := 0; # number of primes found so far #
|
71 |
+
FOR d1 FROM 0 TO 1 DO
|
72 |
+
INT n1 = d1;
|
73 |
+
FOR d2 FROM 0 TO 1 DO
|
74 |
+
INT n2 = IF d2 = 1 THEN ( n1 * 10 ) + 2 ELSE n1 FI;
|
75 |
+
FOR d3 FROM 0 TO 1 DO
|
76 |
+
INT n3 = IF d3 = 1 THEN ( n2 * 10 ) + 3 ELSE n2 FI;
|
77 |
+
FOR d4 FROM 0 TO 1 DO
|
78 |
+
INT n4 = IF d4 = 1 THEN ( n3 * 10 ) + 4 ELSE n3 FI;
|
79 |
+
FOR d5 FROM 0 TO 1 DO
|
80 |
+
INT n5 = IF d5 = 1 THEN ( n4 * 10 ) + 5 ELSE n4 FI;
|
81 |
+
FOR d6 FROM 0 TO 1 DO
|
82 |
+
INT n6 = IF d6 = 1 THEN ( n5 * 10 ) + 6 ELSE n5 FI;
|
83 |
+
FOR d7 FROM 0 TO 1 DO
|
84 |
+
INT n7 = IF d7 = 1 THEN ( n6 * 10 ) + 7 ELSE n6 FI;
|
85 |
+
FOR d8 FROM 0 TO 1 DO
|
86 |
+
INT n8 = IF d8 = 1 THEN ( n7 * 10 ) + 8 ELSE n7 FI;
|
87 |
+
FOR d9 FROM 0 TO 1 DO
|
88 |
+
INT n9 = IF d9 = 1 THEN ( n8 * 10 ) + 9 ELSE n8 FI;
|
89 |
+
IF n9 > 0 THEN
|
90 |
+
IF is probably prime( n9 ) THEN
|
91 |
+
# have a prime with strictly ascending digits #
|
92 |
+
primes[ p count +:= 1 ] := n9
|
93 |
+
FI
|
94 |
+
FI
|
95 |
+
OD
|
96 |
+
OD
|
97 |
+
OD
|
98 |
+
OD
|
99 |
+
OD
|
100 |
+
OD
|
101 |
+
OD
|
102 |
+
OD
|
103 |
+
OD;
|
104 |
+
QUICKSORT primes FROMELEMENT 1 TOELEMENT p count; # sort the primes #
|
105 |
+
FOR i TO p count DO # display the primes #
|
106 |
+
print( ( " ", whole( primes[ i ], -8 ) ) );
|
107 |
+
IF i MOD 10 = 0 THEN print( ( newline ) ) FI
|
108 |
+
OD
|
109 |
+
END
|
110 |
+
```
|
111 |
|
112 |
### Data Fields
|
113 |
|
114 |
+
```
|
115 |
+
Dataset({
|
116 |
+
features: ['task_url', 'task_name', 'task_description', 'language_url', 'language_name', 'code'],
|
117 |
+
num_rows: 79013
|
118 |
+
})
|
119 |
+
```
|
120 |
|
121 |
### Data Splits
|
122 |
|
123 |
+
The dataset only contains one split, namely the "train" split.
|
124 |
|
125 |
## Dataset Creation
|
126 |
|