IdeaMonk

thoughts, ideas, code and other things...

Tuesday, April 07, 2009

Nincompoop is on Allegro.cc :)

I had almost forgotten what I submitted on Allegro.cc 2 months back!
Just got a mail today from Depot Manager on Allegro.cc saying the "Paint Daubs effect in Allegro" and "Nincompoop - The Unfinished Quest" has been added to Projects :)
Checkout http://www.allegro.cc/depot/Nincompoop-TheUnfinishedQuest/

I wish they have another PWNED! (game-dev) contest this year @ Shaastra 2009. Would love to play around some physics engines and XNA this time nopes Pyglet and Pymunk (python port of chipmunk) would be more satisfactory personally. Wish to get into another hacking contest too, just for some faltooo cash :)

Yippeeee!

Labels: , ,

Wednesday, June 18, 2008

Scoring High in Word Games on facebook!



Ever played TextTwirl or WordShuffle on facebook or elsewhere ?

Don't you ever! for they are very addictive as my uber player buddy from Wisconsin warns me. But what can I do, I have my own problems, I'm jobless, there's nothing to do, And I like winning the smart way.
So, what do I do! I think of C++ and a Dictionary... and poof! my weapon is ready in my mind! And soon I come up with my own little tool called WordWar.
Heres the code:

#include <iostream>
using namespace std;

int main(int argc, char *argv[]){
string word,check,cword;
int len,match,count,checksum=0,l;

if (argc>=3){
word = argv[1];
len = word.length();
for (int i=0;i<len;i++)
checksum+=word[i];

freopen (argv[2],"r+",stdin);
if (argc==4){
while (cin >> check){
check[0]=tolower(check[0]);
if (check.length()<=len &amp;&amp; check.length()>=3){
match = 1; count=0;
cword=word;
for (int i=0;i<check.length();i++){
if (cword.find(check[i]) == string::npos){
match=0;
break;
} else {
cword[cword.find(check[i])]='_';
}
}
if (match == 1)
cout << check << endl;
}
}
} else {
while (cin >> check){
if (check.length()==len){
match = 1; count=0;
for (int i=0;i<len;i++){
if (word.find(check[i]) == string::npos){
match=0;
break;
} else {
count+=check[i];
}
}
if (match == 1 &amp;&amp; count==checksum)
cout << check << endl;
}
}
}
} else {
cout << "WordWar v0.1\t\t\t(c) Abhishek Mishra\n"
<<" \t\t\t ideamonk@gmail.com\n\n"
<<"Usage : "<<argv[0]<<"> <dictionary_file>\n\n";
}
return 0;
}

For this you also need a dictionary. Download dictionary here. This is a very basic dictionary, I recommend you to get better one or try adding 's' etc to this ones results. Compile WordWar in DevCPP/MinGW32 on windows or GCC on linux. Have 1.txt (your dictionary) in the same path. and run it like this ->

enjoy scoring high!
With PHP I can also make a neat live web interface to cheat. :)
happy hacking.
http://ideamonk.googlepages.com/ddl.gif

Labels: , ,