New Posts  All Forums:Forum Nav:

worldmole hack

post #1 of 2
Thread Starter 
i made this for the blackberry game wordmole. just enter the letters you get into the game.txt file and it'll generate the longest words it can match with the dictionary.
Code:
 
#include <fstream>
#include <iostream>
#include <string>

using namespace std;
string sort(string letters)
{
  int i, j;
  char temp;

  for (i = (letters.size() - 1); i >= 0; i--)
  {
    for (j = 1; j <= i; j++)
    {
      if ((int)letters[j-1] > (int)letters[j])
      {
        temp = letters[j-1];
        letters[j-1] = letters[j];
        letters[j] = temp;
      }
    }
  }
  return letters;
}
int main()
{
int counter = 0;
  string letters,longestword,words,tempwords,templetters;
  ifstream a_file ( "game.txt" );
  while(!a_file.eof())
  {
  letters.push_back(a_file.get());
  }
  templetters = sort(letters);
  cout << "letters: " << templetters << endl;
  ifstream b_file ("words.txt");
  while(!b_file.eof())
  {
  b_file >> words;
  tempwords = sort(words);
  for(int i=0;i<tempwords.size();i++)
  {
  for(int o=0;o<templetters.size();o++)
  {
  if(templetters[o] == tempwords[i])
  {
  tempwords.replace(i,1,"1");
  templetters.replace(o,1,"3");
  counter++;
  }
  }
  }
  if(counter == words.size() && words.size() > longestword.size())
  {
  longestword = words;
  cout << longestword << endl;
  }
  templetters = sort(letters);
  counter = 0;
  }
  cout << longestword << " end" << endl;
  cin.get();
}
Pepe Silvia
(13 items)
 
  
CPUMotherboardGraphicsRAM
255 @ 4 Ghz MSI 870-C45 GT 520 @ 1Ghz Crucial Rendition 4GB DDR3 
Hard DriveOSMonitorPower
Hitachi 1TB Win 7 19" 420W 
  hide details  
Reply
Pepe Silvia
(13 items)
 
  
CPUMotherboardGraphicsRAM
255 @ 4 Ghz MSI 870-C45 GT 520 @ 1Ghz Crucial Rendition 4GB DDR3 
Hard DriveOSMonitorPower
Hitachi 1TB Win 7 19" 420W 
  hide details  
Reply
post #2 of 2
Just in case you want more points (if that's how it works), attached is a dictionary of 172,000+ words.
RAID0R
(14 items)
 
  
CPUMotherboardGraphicsRAM
i5 750 4.0GHz MSI P55-GD80 GTX 470 | 8800GT PhysX 2x2GB G.Skill Ripjaws 
Hard DriveOptical DriveCoolingOS
60GB Agility 2|1TB RAID0|1.5TB Pioneer DVR-217D XSPC Raystorm | XSPC RX240 Windows 7 Professional x64 
MonitorKeyboardPowerCase
27" Dell 2709W | 17" Samsung Logitech G15 Corsair HX850 Corsair 650D 
Mouse
Microsoft IntelliMouse 
  hide details  
Reply
RAID0R
(14 items)
 
  
CPUMotherboardGraphicsRAM
i5 750 4.0GHz MSI P55-GD80 GTX 470 | 8800GT PhysX 2x2GB G.Skill Ripjaws 
Hard DriveOptical DriveCoolingOS
60GB Agility 2|1TB RAID0|1.5TB Pioneer DVR-217D XSPC Raystorm | XSPC RX240 Windows 7 Professional x64 
MonitorKeyboardPowerCase
27" Dell 2709W | 17" Samsung Logitech G15 Corsair HX850 Corsair 650D 
Mouse
Microsoft IntelliMouse 
  hide details  
Reply
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Coding and Programming