Search found 4 matches
- Thu May 19, 2011 6:14 am
- Forum: Challenges Solved
- Topic: One Minute Man
- Replies: 39
- Views: 4538
Did it in Groovy. Getting the text from the Website and comparing it to the previous result. If there is a difference it is shown on the console. The programm ran for 514minutes :D def url = new URL('http://www.hacker.org/challenge/misc/minuteman.php') def data = url.getText() def result = data def ...
- Wed May 18, 2011 2:51 pm
- Forum: Challenges Solved
- Topic: Valuation
- Replies: 103
- Views: 9353
Groovy Solution
It is possibly not the best Groovy solution, because it looks to much like plain old Java, but it works fine. def text = "93752xxx746x27x1754xx90x93xxxxx" def result = 0 def pointer = 0 textAsChars = text.toList() while(pointer < textAsChars.size()) { curChar = textAsChars[pointer] if(curC...
- Wed May 18, 2011 1:28 pm
- Forum: Challenges Solved
- Topic: 3280
- Replies: 20
- Views: 1769
- Wed May 18, 2011 11:51 am
- Forum: Challenges Solved
- Topic: Lorem Ipsum
- Replies: 34
- Views: 3779
I wanted to solve it with Groovy. Here is the result:
Code: Select all
def words = new File("lorem.txt").getText().split()
words.each( {if (words.count(it) == 1) println it} )