Skip to content

Instantly share code, notes, and snippets.

@mohsin
Created February 3, 2021 06:41
Show Gist options
  • Save mohsin/f484be2eddd7ad896fcc55b746c97bbf to your computer and use it in GitHub Desktop.
Save mohsin/f484be2eddd7ad896fcc55b746c97bbf to your computer and use it in GitHub Desktop.
Postman Galaxy Event Quiz PHP script for solving the word search puzzle
<?php
// Use php 8.0 for str_contains
$arrays = [
'vvtazcszriaudu',
'aoejmmwtfwteoo',
'responsertyanr',
'iytycuyabrfxtx',
'avwlkcmmonitor',
'bijbsufmeqkwtp',
'lqhqlwdmurpbrm',
'eimtulchugildk',
'variable',
'voeyviqi',
'testwjhm',
'ajpylbqt',
'zmockslu',
'cmnucuwl',
'swsymfdc',
'zteammmh',
'rfrboeuu',
'iwtrnqrg',
'atyfikpi',
'ueaxtwbl',
'dontotrd',
'uorxrpmk'
];
$contents = file_get_contents('dictionary.txt'); // Use a dictionary file or alternatively crawl/raid the postman docs and wordify it
$words = explode("\n", $contents);
foreach ($words as $word) {
if (strlen($word) > 3) {
foreach ($arrays as $randomized) {
if (str_contains($randomized, $word) || str_contains($randomized, strrev($word))) {
echo sprintf("%s contains: %s\n", $randomized, $word);
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment