Skip to content
This repository was archived by the owner on Dec 1, 2021. It is now read-only.

Commit bcb0fd7

Browse files
freddiev4colbygk
authored andcommitted
Merge pull request #180 from Altlock/master
Number two is done
2 parents 61d3317 + 451fbaf commit bcb0fd7

File tree

5 files changed

+24
-8
lines changed

5 files changed

+24
-8
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
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+
}

etc/requirements.txt

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
praw>=5.1.0
2+
pprint>=0.1

post-challenges.py

+3-7
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ def get_current_week(num_challenges=1):
2727
num_challenges = int(sys.argv[1])
2828

2929
r = praw.Reddit(user_agent="dailyprogrammer-challenges")
30-
sub = r.get_subreddit("dailyprogrammer")
30+
sub = r.subreddit("dailyprogrammer")
3131

3232
# 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)
3535

3636
# get challenge titles & selftext
3737
challenge_titles = [str(x.title) for x in chals]
@@ -63,10 +63,6 @@ def get_current_week(num_challenges=1):
6363
os.system('mv solutions "{}"'.format(title_lst[i]))
6464
logging.info("Created solutions directory")
6565

66-
logging.info("Started sending data script")
67-
os.system("./send-data.sh")
68-
logging.info("Finished sending data")
69-
7066

7167
# TODO: Move this to a separate file
7268
def get_all_challenges():

transform.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
import glob
1212
import os
13-
import regex
13+
import re
1414

1515
# This script will run on the Easy Medium and Hard directories.
1616

0 commit comments

Comments
 (0)