my solutions
Re: my solutions
Slidy, can you give me a hint? The solver is dope and I'm curios how it works.
Guys, yestarday airbags just randomly deployed in a car I was in and my right ear got fucked from the
blast.These things create a brief and intense pressure wave which can cause hearing loss, hopefully it's not permanent. Going to see doctor today.
Guys, yestarday airbags just randomly deployed in a car I was in and my right ear got fucked from the
blast.These things create a brief and intense pressure wave which can cause hearing loss, hopefully it's not permanent. Going to see doctor today.
Re: my solutions
Sorry to hear that man, hope you're ok
Making the solver is actually simpler than it seems. You have the source code to Chili's Werd Game on GitHub, which makes things a lot easier. You know exactly how the score is calculated, and you know exactly what words are used in the list.
Knowing all of this, you can try to "replicate" that behaviour in a solver and eliminate what words it can't be based on what score the Werd Game bot gives you.
The hardest part was actually making the solver automated on discord by using the Discord.NET API to parse and respond to Chili's bot.
Making the solver is actually simpler than it seems. You have the source code to Chili's Werd Game on GitHub, which makes things a lot easier. You know exactly how the score is calculated, and you know exactly what words are used in the list.
Knowing all of this, you can try to "replicate" that behaviour in a solver and eliminate what words it can't be based on what score the Werd Game bot gives you.
The hardest part was actually making the solver automated on discord by using the Discord.NET API to parse and respond to Chili's bot.
Re: my solutions
They were allowed at the time when I made this as long as you didn't use it to spam/advertise, but seems they recently made them completely banned.
Looks like they don't enforce this all that well though, I used it about 10 times today, spamming around 10 messages each time and my account hasn't been banned yet, so jokes on you Discord overmench!
Looks like they don't enforce this all that well though, I used it about 10 times today, spamming around 10 messages each time and my account hasn't been banned yet, so jokes on you Discord overmench!
Re: my solutions
Nah, you'd have to be pretty dumb/obvious with it to get any sort of consequences. Enjoy your contraband botting you renegade.
Chili
Re: my solutions
Code: Select all
std::string solve(std::vector<std::string>& filteredWordsCopy, std::string target) {
std::mt19937 rng(std::random_device{}());
std::uniform_int_distribution<int> dist(0, filteredWordsCopy.size() - 1);
const std::string guessedWord = filteredWordsCopy[dist(rng)];
int targetScore = score_match(guessedWord, target);
std::vector<std::string> intersection;
for (const auto& w : filteredWordsCopy)
{
if (score_match(w, guessedWord) >= targetScore && w != guessedWord)
{
intersection.push_back(w);
}
}
filteredWordsCopy= intersection;
return guessedWord;
}
int main()
{
..
while( true )
{
std::cout << "Guess a five letter word: ";
std::string guess;
guess = solve(filetered_word2, target);
..
Re: my solutions
Yeah that seems pretty good, but you can eliminate more words based on the guess. You're only eliminating words that have a score less than the targetScore, but if you think about it you can eliminate any word that has a score not equal to the targetScore. After doing that, the number of attempts it takes should go down, my lowest was about 4.
Re: my solutions
Thank you Slidy, works better now.
Homework on Tutorial 13 is to modify the Animation class so that it draws the sprite frames with a translucent "ghost" effect. Are we allowed to modify any other class?
Homework on Tutorial 13 is to modify the Animation class so that it draws the sprite frames with a translucent "ghost" effect. Are we allowed to modify any other class?
-
- Posts: 4373
- Joined: February 28th, 2013, 3:23 am
- Location: Oklahoma, United States
Re: my solutions
Shouldn't need to if I recall correctly. You are to create a SpriteEffect I believe, to pass in as a parameter, but it's been awhile since going over that section.
If you think paging some data from disk into RAM is slow, try paging it into a simian cerebrum over a pair of optical nerves. - gameprogrammingpatterns.com
Re: my solutions
I couldn't do it from the animation class but got it working by modifying the graphics class.
In Game::ComposeFrame() Character link is drawn last.
This works but I wanted to make it so the foreground object is drawn with percentage transperancy which is passed in DrawSprite as a paramether. Could not figure out the formula though.
Code: Select all
Color Graphics::getPixel(int x, int y)
{
return pSysBuffer[Graphics::ScreenWidth * y + x];
}
void DrawSprite( int x,int y,RectI srcRect,const RectI& clip,const Surface& s,Color chroma = Colors::Magenta );
...
...
...
for( int sy = srcRect.top; sy < srcRect.bottom; sy++ )
{
for( int sx = srcRect.left; sx < srcRect.right; sx++ )
{
Color srcPixel = s.GetPixel( sx,sy );
if( srcPixel != chroma )
{
Color gfxColor = getPixel(x + sx - srcRect.left, y + sy - srcRect.top);
Color newColor;
newColor.SetB((srcPixel.GetB() + gfxColor.GetB())/ 2);
newColor.SetR((srcPixel.GetR() + gfxColor.GetR()) / 2);
newColor.SetG((srcPixel.GetG() + gfxColor.GetG()) / 2);
PutPixel( x + sx - srcRect.left,y + sy - srcRect.top, newColor);
}
}
}
This works but I wanted to make it so the foreground object is drawn with percentage transperancy which is passed in DrawSprite as a paramether. Could not figure out the formula though.