I before E except after C: Difference between revisions

m
(Added Julia language)
Line 1,893:
The plausibility of the phrase 'I before E except after C' is False
</pre>
 
==={{header|Alternative Implementation}}===
<lang Powershell>$Web = New-Object -TypeName Net.Webclient
$Words = $web.DownloadString('http://www.puzzlers.org/pub/wordlists/unixdict.txt')
$IE = $EI = $CIE = $CEI = @()
$Clause1 = $Clause2 = $MainClause = $false
foreach ($Word in $Words.split())
{
switch ($Word)
{
{$_ -like '*cei*'} {$CEI += $Word; break}
{$_ -like '*cie*'} {$CIE += $Word; break}
{$_ -like '*ie*'} {$IE += $Word}
{$_ -like '*ei*'} {$EI += $Word}
}
}
if ($IE.count -gt $EI.count * 2)
{$Clause1 = $true}
"The plausibility of 'I before E when not preceded by C' is $Clause1"
if ($CEI.count -gt $CIE.count * 2)
{$Clause2 = $true}
"The plausibility of 'E before I when preceded by C' is $Clause2"
if ($Clause1 -and $Clause2)
{$MainClause = $True}
"The plausibility of the phrase 'I before E except after C' is $MainClause"</lang>
{{out}}
<pre>
The plausibility of 'I before E when not preceded by C' is True
The plausibility of 'E before I when preceded by C' is False
The plausibility of the phrase 'I before E except after C' is False
</pre>
 
=={{header|PureBasic}}==
<lang purebasic>If ReadFile(1,GetPathPart(ProgramFilename())+"wordlist(en).txt")
Anonymous user