Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/perl
$l=($s='rtlntr"" ,h ahkP trcr\ain;eepeusnoJ')=~y///c;for(1..$l){@a=sort@a;
for(0..$l-1){$a[$_]=substr($s,$_,1).$a[$_]}}for(@a){eval$_ if/;$/}
@mgcaret
mgcaret / mastermind.rb
Created February 18, 2016 17:56
HexChat MRuby plugin for playing Mastermind AKA Bulls & Cows
# This HexChat MRuby plugin lets people play a game of
# Mastermind AKA Bulls & Cows
# https://en.wikipedia.org/wiki/Bulls_and_Cows
class Bulls < HexChat::Plugin
# So it works on a channel:
on :print, 'Channel Message' do |words|
process_event(words)
EAT_NONE
end