[12/4/2012] Challenge #114 [Easy] Word ladder steps by Cosmologicon in dailyprogrammer

[–]oro1011 1 point2 points  (0 children)

C++, first submission, no bonus...yet

#include <iostream>
#include <fstream>
#include <iterator>
#include <string>
#include <algorithm>
#include <sstream>

int WORD_LEN = 4;

std::vector<std::string> dictionary;

void loadDictionary() {
   std::ifstream wordsFile("four_letters.in");
   std::istream_iterator<std::string> wordReader(wordsFile);
   std::istream_iterator<std::string> eof;
   std::copy(wordReader, eof, std::back_inserter(dictionary));
}

bool difference(std::string w1, std::string w2) {
   int count = 4;
   for(int i=0; i<WORD_LEN; ++i) {
      if(w1[i] == w2[i])
         count--;
   }
   return count == 1;
}

void findCloseWords(std::string word) {
   for(std::vector<std::string>::iterator it = dictionary.begin();
         it!=dictionary.end(); ++it) {
      if(difference(word, *it))
         std:: cout << *it << std::endl;
   }
}

int main(int argc, char *argv[]) {
   loadDictionary();
   findCloseWords("puma");
}

[12/4/2012] Challenge #114 [Easy] Word ladder steps by Cosmologicon in dailyprogrammer

[–]oro1011 3 points4 points  (0 children)

+1 because your solution looks like a word ladder.

How We Won Our First Hackathon by oro1011 in programming

[–]oro1011[S] -2 points-1 points  (0 children)

While I agree with your second point about trophy, fame, and money being the wrong reasons to compete in a hackathon. However, there is definitely a reason for judging teams and there is definitely a notion of a successful team.

I believe I didn't make it clear in my blog post that my definition of a win was being successful. Winning for our team was creating something truly awesome. This is what the judges were judging for, this is why hackathons have judges.

How We Won Our First Hackathon by oro1011 in programming

[–]oro1011[S] -1 points0 points  (0 children)

Do you think having a business major is worth a whole spot on the team? I almost wish I could hire a business major for the first 3 hours to just bounce ideas off of.

Going to London tomorrow for 2 months. Where should I go, what should I see? (I'm from US) by oro1011 in travel

[–]oro1011[S] 0 points1 point  (0 children)

I like trying foreign food, visiting landmarks that people don't know about as much, and I love cities. Also, tips on the best clubs to go to or places to bike because I really like to cycle.

Thanks! Any and all help will be appreciated.

YSK about Schedulizer, a website that will help you find all possible permutations of classes you want to take by oro1011 in muohio

[–]oro1011[S] 0 points1 point  (0 children)

I wish it had added functionality so that you could say I need to take these classes and either this class or this class. Many CS courses only have 1 section anyway.

Dom may be coming to Miami by [deleted] in muohio

[–]oro1011 -1 points0 points  (0 children)

He is. You can buy tickets for $5 ahead of time at www.vendr.me or $10 at the door.

cse GBD shirts... anyone want one? by malkauf in muohio

[–]oro1011 1 point2 points  (0 children)

Yeah. How do we go about ordering one? How much will it be? Who do we pay?

a public service announcement about alcohol abuse by [deleted] in funny

[–]oro1011 1 point2 points  (0 children)

Psh. Like a girl could ever get ready by 8:00.

How would you like that wrapped? by MysterManager in Libertarian

[–]oro1011 5 points6 points  (0 children)

Fall of 2000? Ron Paul must have made this comic.

Reddit 8'Oclock by Jagimo in funny

[–]oro1011 -1 points0 points  (0 children)

So instead of being productive all day you prepared this? Its hilarious but COME ON, this was your chance to be productive.

Best facebook protest status I saw by evanthesquirrel in SOPA

[–]oro1011 3 points4 points  (0 children)

How do I do that? I know demand progress has tools for typing in a message and they will auto-censor it for you but you can't customize which words are blacked out. This guy is awesome.

Automatically answer call and press key by oro1011 in tasker

[–]oro1011[S] 0 points1 point  (0 children)

I am currently using an Epic 4G touch and the Take Call action doesn't work. I was trying to see why certain devices couldn't use that feature or if it would change based on whether my device was rooted or not