The Altera Centauri collection has been brought up to date by Darsnan. It comprises every decent scenario he's been able to find anywhere on the web, going back over 20 years.
25 themes/skins/styles are now available to members. Check the select drop-down at the bottom-left of each page.
Call To Power 2 Cradle 3+ mod in progress: https://apolyton.net/forum/other-games/call-to-power-2/ctp2-creation/9437883-making-cradle-3-fully-compatible-with-the-apolyton-edition
Announcement
Collapse
No announcement yet.
what's the 5 letter word with the most one-word anagrams?
"I hope I get to punch you in the face one day" - MRT144, Imran Siddiqui
'I'm fairly certain that a ban on me punching you in the face is not a "right" worth respecting." - loinburger
Well, hell. I must say that I managed to impress myself with Haskell.
Code:
module Main where
import Data.List
import Data.Char
length_order a b = let l_a = length a
l_b = length b
order | l_a == l_b = EQ
| l_a < l_b = LT
| l_a > l_b = GT
in order
main = interact $
(\line -> unlines . take 1 . last . sortBy length_order
. group . sort . map sort . map (map toLower)
. filter (\line -> length line == 5) $ words line)
(a couple of hours later, I realised that length_order was comparing in reverse... I'd just quickly hacked it up in order to get the right result. Fixed.)
This code finds out that the letter combination to look out for is "agnor" (in alphabetic order, all-lowercase). Here's another program, to find out what words actually anagrammize to that:
Code:
module Main where
import Data.List
import Data.Char
main = interact $
(\input -> unlines $ filter
(\word -> (sort (map toLower word)) == "agnor") $ lines input)
Code:
angor
argon
goran
grano
groan
nagor
Orang <-- please remember I've been
orang <-- using a Unix for 7 years
organ
rogan
Ronga
(the source for these words is, of course, /usr/share/dict/words, aka Webster's Second International, from 1934)
Last edited by Ari Rahikkala; December 1, 2006, 19:47.
So get your Naomi Klein books and move it or I'll seriously bash your faces in! - Supercitizen to stupid students Be kind to the nerdiest guy in school. He will be your boss when you've grown up!
Originally posted by Ari Rahikkala
Well, hell. I must say that I managed to impress myself with Haskell.
Here's mine. A combination of C and bash:
First I took a wordlist (only 5 letter words) with one word on each line. Then I used gedit to add in a series of bash commands (using find/replace on the newlines) so I got a second file like this.
#include
#include
int rvd5(int a, int b, int c, int d, int e);
int rvd6(int a, int b, int c, int d, int e, int f);
main()
{
char word[80];
int count, tag, i, j, k, l, m, n;
for (count=0; (word[count] = getchar()) != '\n'; ++count)
;
tag = count;
printf ("#!/bin/bash\n");
printf ("rm -f jmbtmpfile\n");
if (tag == 5) {
for (i = 0; i <= 4; i++){
for (j = 0; j <= 4; j++){
for (k = 0; k <= 4; k++){
for (l = 0; l <= 4; l++){
for (m = 0; m <= 4; m++){
if (rvd5(i,j,k,l,m) != 0)
printf("grep -c \'%c%c%c%c%c\' 5letlist.txt >> jmbtmpfile \n", word[i], word[j], word[k], word[l], word[m]);
}
}
}
}
}
}
if (tag == 6) {
for (i = 0; i <= 5; i++){
for (j = 0; j <= 5; j++){
for (k = 0; k <= 5; k++){
for (l = 0; l <= 5; l++){
for (m = 0; m <= 5; m++){
for (n = 0; n <= 5; n++){
if (rvd6(i,j,k,l,m,n) != 0)
printf("grep -c \'%c%c%c%c%c%c\' 6letlist.txt >> jmbtmptile \n", word[i], word[j], word[k], word[l], word[m], word[n]);
}
}
}
}
}
}
}
printf("grep -c \'1\' jmbtmpfile \n");
}
int rvd5(int a, int b, int c, int d, int e)
{
int ans = 1;
if (a == b)
ans = 0;
if (a == c)
ans = 0;
if (a == d)
ans = 0;
if (a == e)
ans = 0;
if (b == c)
ans = 0;
if (b == d)
ans = 0;
if (b == e)
ans = 0;
if (c == d)
ans = 0;
if (c == e)
ans = 0;
if (d == e)
ans = 0;
return(ans);
}
int rvd6(int a, int b, int c, int d, int e, int f)
{
int ans = 1;
if (a == b)
ans = 0;
if (a == c)
ans = 0;
if (a == d)
ans = 0;
if (a == e)
ans = 0;
if (a == f)
ans = 0;
if (b == c)
ans = 0;
if (b == d)
ans = 0;
if (b == e)
ans = 0;
if (b == f)
ans = 0;
if (c == d)
ans = 0;
if (c == e)
ans = 0;
if (c == f)
ans = 0;
if (d == e)
ans = 0;
if (d == f)
ans = 0;
if (e == f)
ans = 0;
return(ans);
}
Mine was originally written to cheat on the jumble in the paper. That's why it's roundabout. I already had something written. And that's why it's called jmb2.c and jmb2.sh...
Comment