Jump to content

Kernighans large earthquake problem: Difference between revisions

m
Line 347:
<lang python>from os.path import expanduser
from functools import (reduce)
import re
 
 
Line 367 ⟶ 366:
 
# GENERIC ABSTRACTIONS ----------------------------
 
# words :: String -> [String]
def words(s):
return re.split('\s+', s)
 
 
Line 388 ⟶ 383:
def readFile(fp):
return open(expanduser(fp)).read()
 
 
# words :: String -> [String]
def words(s):
return res.split('\s+', s)
 
 
9,659

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.