This repository was archived by the owner on Dec 1, 2021. It is now read-only.
File tree 5 files changed +24
-8
lines changed
Challenge 0002 Easy/solutions
Challenge 0208 Easy - Culling Numbers/solutions
5 files changed +24
-8
lines changed Original file line number Diff line number Diff line change
1
+ if 0 {
2
+ Author: Altlock
3
+
4
+ Description: Calculation done with command line arguments.
5
+ }
6
+
7
+ # Get correct amount of arguments
8
+
9
+ if {$argc != 3 && $argc != 4} {
10
+ puts " This script requires exactly 3 or 4 numbers to be put in."
11
+ puts " For example: (tclsh $argv0 160 5 39),"
12
+ puts " the calculation of the example is (160 % 5 + 39 = 39)."
13
+ puts " If you put in 4 numbers, the sum will be multiplied by that number."
14
+ } elseif {$argc == 3} { ;# If correct amount, calculate
15
+ puts [expr [lindex $argv 0] % [lindex $argv 1] + [lindex $argv 2]]
16
+ } else {
17
+ puts [expr ([lindex $argv 0] % [lindex $argv 1] + [lindex $argv 2]) * [lindex $argv 3]]
18
+ }
File renamed without changes.
Original file line number Diff line number Diff line change
1
+ praw >= 5.1.0
2
+ pprint >= 0.1
Original file line number Diff line number Diff line change @@ -27,11 +27,11 @@ def get_current_week(num_challenges=1):
27
27
num_challenges = int (sys .argv [1 ])
28
28
29
29
r = praw .Reddit (user_agent = "dailyprogrammer-challenges" )
30
- sub = r .get_subreddit ("dailyprogrammer" )
30
+ sub = r .subreddit ("dailyprogrammer" )
31
31
32
32
# retrieve generators for top posts
33
- chals = sub .get_new (limit = num_challenges )
34
- _chals = sub .get_new (limit = num_challenges )
33
+ chals = sub .new (limit = num_challenges )
34
+ _chals = sub .new (limit = num_challenges )
35
35
36
36
# get challenge titles & selftext
37
37
challenge_titles = [str (x .title ) for x in chals ]
@@ -63,10 +63,6 @@ def get_current_week(num_challenges=1):
63
63
os .system ('mv solutions "{}"' .format (title_lst [i ]))
64
64
logging .info ("Created solutions directory" )
65
65
66
- logging .info ("Started sending data script" )
67
- os .system ("./send-data.sh" )
68
- logging .info ("Finished sending data" )
69
-
70
66
71
67
# TODO: Move this to a separate file
72
68
def get_all_challenges ():
Original file line number Diff line number Diff line change 10
10
11
11
import glob
12
12
import os
13
- import regex
13
+ import re
14
14
15
15
# This script will run on the Easy Medium and Hard directories.
16
16
You can’t perform that action at this time.
0 commit comments