Is it a lipogram?

52

1

A lipogram is a block of words that omits a particular symbol. Right now, I am avoiding our fifth symbol of 26 that commonly show up. You should know by now what I am omitting. If not, look up "lipogram" and you will know.

Your Task

With a char, a blank, and a following string (blanks may show up in this; with only ASCII 32-126 chars) in input, output falsy if this char is in input string, truthy if not. This char that you must look for will always fit in two spans: "A" to "Z" or "a" to "z" (ASCII 65-90, 97-122). Do not distinguish capitals and non-capitals. Also, don't worry about blanks or punctuation symbols. Both programs and functions satisfy. Also, you may split input char and string into two args for programs or functions, and string as first arg is okay.

Illustrations

Truthy

e This is a lipogram.
a You need to consider other letters too.
E Capitals also count.

Falsy

e This sentence is not a lipogram (for e).
t This particular letter is surprisingly hard.
A You don't need to care about any non-alphabetic symbols.

Non-lipogrammed version

A lipogram is a series of words that leaves out a letter. I left out the letter "e" above.

Your task is to take a character and a string (which may include spaces) as input, separated by a space or newline, and output falsy if the character is in the string, and truthy otherwise. You may assume the string is composed solely of printable ASCII characters (char codes 32-126). The character will always be in the English alphabet, and there is no difference between lowercase and uppercase. The character will not be a space or symbol. You may write a program or a function. For either, you may take the character and string as separate arguments, and the string may come first.

El'endia Starman

Posted 2016-02-22T19:20:33.327

Reputation: 14 504

For full programs may I take input as separate lines? – Blue – 2016-02-22T19:40:51.540

@muddyfish: Yes. – El'endia Starman – 2016-02-22T19:41:07.843

... and string as first arg is ok. – edc65 – 2016-02-22T20:56:23.837

@edc65: Oh, I like that better. – El'endia Starman – 2016-02-22T20:57:07.703

1You should try "and a string as your first arg is okay." or a similar configuration. – mbomb007 – 2016-02-25T14:42:31.290

Also, I think a source-restriction challenge is in sight... – mbomb007 – 2016-02-25T14:44:01.580

Answers

36

C, 42 bytes

#define f(c,s)!strchr(s,c)&!strchr(s,c^32)

Josh

Posted 2016-02-22T19:20:33.327

Reputation: 2 783

8Codegolfing in C, Ubercodegolfing. – Brain Guider – 2016-02-23T09:45:34.877

25

Javascript ES6 34 26 23 Bytes

x=>!/^(.).*\1/i.test(x)

shaved 8 bytes thanks @MartinBüttner

Shaun H

Posted 2016-02-22T19:20:33.327

Reputation: 732

9Wow, I didn't know that /i affected \1! – Neil – 2016-02-22T22:17:33.523

18

05AB1E, 7 6 4 3 bytes

Code:

l`-

Explanation:

l     # Convert both elements to lowercase
 `    # Flatten the array
  -   # Loop over the second line of text and substract each char from the first character
        For example: "abcde""ba"- would result in "cde"

Try it online!

Truthy is when the current letter is outputted. Falsy is when nothing is outputted.

Adnan

Posted 2016-02-22T19:20:33.327

Reputation: 41 965

So - effectively does a complement operation?

– 2012rcampion – 2016-02-23T02:15:07.660

@2012rcampion Yes, that is correct. But only when both values are not integers. – Adnan – 2016-02-23T12:44:25.417

14

TeaScript, 5 3 bytes

AµN

Aha \o/! I forgot about implicit input! TeaScript will automatically insert x. (the input) at the beginning. I can then check if it has the other input (in variable µ) and so a NOT (N). I guess TeaScript's best advantage here is its implicit input

Try it online

Explanation

  A µ  N
x.A(y).N  // At compile time

x.A // input, has...
(y) // second input
N   // Logical NOT

Downgoat

Posted 2016-02-22T19:20:33.327

Reputation: 27 116

Wow. Much built-in. That reminds me, Japt has this same built-in... cuts another two bytes off :) – ETHproductions – 2016-02-23T01:57:47.463

12

Japt, 12 6 4 bytes

!VoU

Test it online!

@Downgoat's TeaScript answer reminded me that Japt has exactly the same built-in, cutting off a final two bytes.

How it works

       // Implicit: U = input char, V = input string
VoU    // Keep only the chars in V that are equal to U, ignoring case.
!      // Take logical NOT. Returns true if no matches were found, false otherwise.

ETHproductions

Posted 2016-02-22T19:20:33.327

Reputation: 47 880

@CᴏɴᴏʀO'Bʀɪᴇɴ Thanks to a built-in I had forgotten about, it's now even shorter :) – ETHproductions – 2016-02-23T01:57:05.090

6um wait no that's too short – Conor O'Brien – 2016-02-23T01:57:37.147

12

Bash, 16 11 bytes

grep -iv $1

-i is the case-insensitive flag, -v inverts (checks for a non-match).

Character must be provided as a command line argument, and the test string on STDIN.

Reduced by 5 bytes with @DigitalTrauma's help!

Sample runs:

llama@llama:~$ echo 'This is a lipogram' | ./lipogram.sh e
This is a lipogram.
llama@llama:~$ echo 'This sentence is not a lipogram (for e).' | ./lipogram.sh e

Doorknob

Posted 2016-02-22T19:20:33.327

Reputation: 68 138

Why not read the sentence from STDIN? grep -iv $1. I don't see anything wrong with mixing STDIN and command-line args as input methods - I done it before - but perhaps there is a meta precedent I have missed... – Digital Trauma – 2016-02-22T20:19:04.237

@DigitalTrauma I considered that, but figured it'd be a bit sketchy. Perhaps a topic to be discussed on meta. – Doorknob – 2016-02-22T20:21:54.540

2Programs may combine two or more input methods – Dennis – 2016-02-22T20:24:47.357

Good find @Dennis! – Digital Trauma – 2016-02-22T21:27:49.660

1Can we get any more ^D users to comment on this answer? @Downgoat - are you there? ;-) – Digital Trauma – 2016-02-22T21:30:10.237

@DigitalTrauma the EOT control char or the letter D? :P – Downgoat – 2016-02-24T16:48:58.443

10

CJam, 6 byte

lel(&!

Try it online! lel

Explanation

l  e# Read a line of input.
el e# Convert to lower case.
(  e# Pull off the first character.
&  e# Set intersection with the rest of the input.
!  e# Logical NOT.

Martin Ender

Posted 2016-02-22T19:20:33.327

Reputation: 184 808

9

JavaScript (ES6), 29 bytes

(c,s)=>!RegExp(c,'i').test(s)

Neil

Posted 2016-02-22T19:20:33.327

Reputation: 95 035

4You can curry the answer as c=>s=>!RegExp(c,"i").test(s), saving a byte. – Conor O'Brien – 2016-02-22T19:54:13.887

c=>s=>!s.match(c,'i') is 21. :) – ETHproductions – 2016-02-22T20:03:52.033

@ETHproductions match only takes one argument. The second argument logs a console warning in Firefox 39 or later, and won't work in Firefox 47 at all. – Neil – 2016-02-22T22:15:35.727

@Neil I'm using Firefox 44, and it seems to work perfectly fine. – ETHproductions – 2016-02-22T22:18:03.010

@ETHproductions Sure, but I have no reason to believe it works in other browsers, and it will also stop working in Firefox soon. – Neil – 2016-02-22T22:47:42.367

7

Python 3, 36

Having to ignore case is surprisingly expensive.

lambda a,b:a.lower()not in b.lower()

Takes the arguments as (char, string)

Morgan Thrapp

Posted 2016-02-22T19:20:33.327

Reputation: 3 574

6

Pyth, 8 7 bytes

-rz0rw0

Explanation

 rw0    -  input().lower()
-       - ^ - V
    rw0 -  input().lower()

Thanks @FryAmTheEggman for telling me I can use - instead of !}

Try it here

Blue

Posted 2016-02-22T19:20:33.327

Reputation: 26 661

6

Perl, 11 + 1 = 12 bytes

$_=lc!~lc<>

Requires the -p switch and takes input as $string\n$letter

$ perl -pe'$_=lc!~lc<>' <<< $'this is a lipogram\ne'
1

How it works:

            # -p auto reads input into $_ and auto prints at the end
   lc       # lowercase $_
     !~     # Check against regex
       lc<> # Read next line and lowercase it. '=~' will expect the rValue to be
            # a regex and therefore the result from 'lc<>' will be treated as such
$_=         # Assign result ('1' or '') to $_ which will be printed

andlrc

Posted 2016-02-22T19:20:33.327

Reputation: 1 613

You should specify your shell. For me, bash on Ubuntu, this prints 1 no matter the input, following the template you give. (I don't know why, but, then, I'm unfamiliar with <<<.) (And using normal STDIN (no <<<), I get 1 unless the letter is the last character in the string, because you don't chomp the letter.) – msh210 – 2016-06-02T21:35:42.613

@msh210 You can use printf "this is a lipogram\ne\n" | perl -pe'$_=lc!~lc<>' instead. <<< is bash syntax. – andlrc – 2016-06-02T21:51:41.353

@msh210 <<< is just another way to pass stdin. – andlrc – 2016-06-02T21:57:48.577

6

O, 8 bytes

{_.@_-=}

An anonymous function that takes a character and a string.

Try it online.

Explanation

{_.@_-=}

{      }
 _        Lowercase string
  .       Duplicate
   @      Rotate stack
    _     Lowercase character
     -    Remove all instances of the character
      =   Compare to original

a spaghetto

Posted 2016-02-22T19:20:33.327

Reputation: 10 647

Why does this need to be a function? Why not just have it be a program? – phase – 2016-02-24T06:22:19.683

@phase I couldn't figure out what char was split. At any rate, I'm pretty sure it's shorter as a function anyways. – a spaghetto – 2016-02-24T16:02:06.323

5

Seriously, 6 bytes

,ù,ùíu

Try it online!

Takes input as 'string'\n'char'

Explanation:

,ù,ùíu
,ù      get string (lowercase)
  ,ù    get char (lowercase)
    íu  1-based index (0 if not found)

Mego

Posted 2016-02-22T19:20:33.327

Reputation: 32 998

Wouldn't something like ,ù,ùìuY work? (That's supposed to be the I that does indexOf but I don't remember which one does that) – quintopia – 2016-02-23T06:09:26.187

5

Java, 63 bytes.

boolean f(String s,char c){return!s.matches("(?i:.*"+c+".*)");}

shooqie

Posted 2016-02-22T19:20:33.327

Reputation: 5 032

You could also write a lambda expression (s,c)->!s.matches("(?i:.*"+c+".*)") which is shorter – RAnders00 – 2016-02-22T22:41:44.587

1It wouldn't be a proper method though, you have to put String and char somewhere. – shooqie – 2016-02-23T15:56:54.923

5

Julia 0.3, 22 20 bytes

c%s=c&95∉[s...]&95

uppercase is a long word.

How it works

c%s=c&95∉[s...]&95

c%s=                Redefine the binary operator % so it takes a character c and
                    a string s and...
     c&95                Compute lo bitwise AND of c and 95.
                         This casts the character c to uppercase.
          [s...]         Yield the list of the characters of the string s.
                &95      Compute lo bitwise AND of each chararacter and 95.
                         This casts the characters of s to uppercase.
         ∉               Return a Boolean, signaling non-membership.

Dennis

Posted 2016-02-22T19:20:33.327

Reputation: 196 637

5

MATL, 5 bytes

kikm~

Try it online!

k        % take first input (letter) implicitly. Convert to lowercase
ik       % take second input (text). Convert to lowercase
m        % ismember function
~        % negate

Luis Mendo

Posted 2016-02-22T19:20:33.327

Reputation: 87 464

4

Pyke, 7 bytes

Dl3+R{!

Explanation:

D       -     eval_or_not(input()).lower()
 l3     -    ^.swapcase()
   +    -   ^+^
    R   -  rotate 2
     {  -  ^ in ^
      ! - not ^

Blue

Posted 2016-02-22T19:20:33.327

Reputation: 26 661

4

Retina, 11

iA`^(.).*\1

I'm not sure what counts as truthy / falsy in Retina, this will echo the line if it is a lipogram for the given character, and it will return the empty string if it isn't.

This will also work for multiline input.

Try it online!

FryAmTheEggman

Posted 2016-02-22T19:20:33.327

Reputation: 16 206

An empty string is falsy, so that counts. – El'endia Starman – 2016-02-22T19:31:58.623

4

PowerShell, 36 32 30 29 25 bytes

param($a,$b)$b-notmatch$a

Uses the -notmatch operator, and simply outputs True or False.

AdmBorkBork

Posted 2016-02-22T19:20:33.327

Reputation: 41 581

4

CJam, 10 bytes

{el\ele=!}

An anonymous function (block) that takes a character (not a string!) and a string.

Try it online.

Explanation

{el\ele=!}

{        }
 el\el      lowercase both args
      e=    count occurrences of the character
        !   logical not

a spaghetto

Posted 2016-02-22T19:20:33.327

Reputation: 10 647

4

Minkolang 0.15, 10 bytes

$or7Z0Z,N.

Try it here.

Explanation

$o            Read in whole input as characters
  r           Reverse stack
   7Z         Lowercase everything
     0Z       Pop top of stack (a) and count how many 'a's are in the stack
       ,      'not' the top of stack
        N.    Output as number and stop.

El'endia Starman

Posted 2016-02-22T19:20:33.327

Reputation: 14 504

4

Jelly, 8 bytes

ḢO^O&95P

Try it online!

How it works

ḢO^O&95P  Main link. Input: S (string)

Ḣ         Pop the first character of S.
 O        Ordinal; compute its code point.
  ^O      XOR it with the code points of the remaining characters.
    &95   AND each result with 95.
       P  Take the product of the results.

Dennis

Posted 2016-02-22T19:20:33.327

Reputation: 196 637

Wait, jelly isn't winning? There must be a way to golf it down further! – Generic User – 2016-02-22T21:30:44.690

Not when strings are involved... – Dennis – 2016-02-22T21:52:03.477

This must be rectified. – CalculatorFeline – 2016-02-22T22:08:46.443

4

Rust, 75 bytes

|c:char,s:&str|!s.to_lowercase().contains(c.to_lowercase().next().unwrap())

Biggest score means I win, right? >_<

Try it here.

Doorknob

Posted 2016-02-22T19:20:33.327

Reputation: 68 138

4

Python, 34 bytes

lambda c,s:c not in s+s.swapcase()

Checks for character c being in string s, ignoring case by appending a case-swapped copy of s to s. The negation is done with not, which looks lengthy but I don't see better. This is same length:

lambda c,s:(c in s+s.swapcase())<1

You can't omit the parens or else Python will interpet the expression as a chained three-value inequality of form _ in _ < _.

Python 3.5 should allow 33 bytes via set conversions, though I can't test it now.

lambda c,s:{*c}-{*s+s.swapcase()}

xnor

Posted 2016-02-22T19:20:33.327

Reputation: 115 687

3

JavaScript ES6, 41 40 bytes

x=>!~x.slice(2).search(RegExp(x[0],"i"))

Takes the entire string as an argument. I cannot save bytes by accepting two different arguments because then my answer would melt into the other ES6 answer :(

Conor O'Brien

Posted 2016-02-22T19:20:33.327

Reputation: 36 228

I win this time, ES6. ;) Your anonymous function syntax is no match for my not in. – Morgan Thrapp – 2016-02-22T19:47:33.860

@MorganThrapp Gahh, foiled again! – Conor O'Brien – 2016-02-22T19:47:49.150

that's ok I got this, You move @MorganThrapp.

– Shaun H – 2016-02-22T21:14:23.633

3

R, 26 bytes

 function(x,y)!grepl(y,x,T)

x is the string, y is the letter, the T in the call to grepl makes it case insensitive.

mnel

Posted 2016-02-22T19:20:33.327

Reputation: 826

3

Jolf, 6 7 bytes

So. Many. Sixes. SMS? Well, try it here nonetheless. Replace with \x7f.

⌂ MiI'i
⌂_M      match with flags
   i     the input
    I    with another input
     'i  using i as a flag

Conor O'Brien

Posted 2016-02-22T19:20:33.327

Reputation: 36 228

2

Ruby, 17 bytes

->c,s{/#{c}/i!~s}
->c,s{  # lambda with two arguments
/#{c}/  # turn the input character into a regexp w/ interpolation
i       # case insensitive
!~      # does not match
s       # input string
}

Doorknob

Posted 2016-02-22T19:20:33.327

Reputation: 68 138

2

Mathematica, 33 32 bytes

StringFreeQ[##,IgnoreCase->1>0]&

I love it when ## can be used. Input is string, then char.

Or, a case sensitive version: (11 bytes:)

StringFreeQ

Yep, just a builtin.

CalculatorFeline

Posted 2016-02-22T19:20:33.327

Reputation: 2 608

2

Batch, 53 bytes

@set s=%2
@call set t=%%s:%1=%%
@if %s%==%t% echo 1

Accepts input as two command-line arguments. (Quote the second argument if necessary.) Outputs 1 on success, nothing if the first argument is (insensitively) found in the second.

Neil

Posted 2016-02-22T19:20:33.327

Reputation: 95 035

2

Haskell, 45 bytes

import Data.Char
t=toLower
(.map t).notElem.t

Usage example: ( (.map t).notElem.t ) 'a' "You need to consider other letters too" -> True.

It's a pointfree version of f c s = notElem (toLower c) (map toLower s), i.e. convert letter and string to lowercase and see if the letter is not in the string.

nimi

Posted 2016-02-22T19:20:33.327

Reputation: 34 639

2

Java 8 lambda, 48 46 bytes

Thanks to @Geobits for pointing out my stupidity and saving me 2 bytes!

(String i,char o)->i.split("(?i)"+o).length<2;

Splits the string if the sought char is found. Returns true if it is contained, false otherwise.

Addison Crump

Posted 2016-02-22T19:20:33.327

Reputation: 10 763

Why not (String i,char o)->!i.contains(o) with Java 8? – Denker – 2016-02-25T13:28:52.007

@DenkerAffe Didn't work insensitively. Fixed now, in lambda form. – Addison Crump – 2016-02-25T13:48:42.907

1

Befunge 27x2 = 54 bytes

 >:~:1+#v_1.@>\:88*`#v_$$
#^_0.@  >\: #^_$~%:0 >84*%-

Try It Online

A shorter version that doesn't account for non-alpha characters

 >:~:1+#v_1.@_~$84*%
#^_0.@  >\:!#^_\84*%-

Jo King

Posted 2016-02-22T19:20:33.327

Reputation: 38 234

1

Lua, 47 Bytes

Simply use string.find() and a ternary to know if there's a prohibited character in the string.

Takes input via command-line: lua golf.lua 'e' "This is a Lipogram."

Edit: Saved 20 Bytes thanks to @Oleg V. Volkov.

print(not arg[2]:lower():find(arg[1]:lower())) 

Katenkyo

Posted 2016-02-22T19:20:33.327

Reputation: 2 857

There's no need to waste bytes asigning to c, arg[2] could use a lower too, and right now it ouputs bad value 0, which is true in Lua. print(not arg[2]:lower():find(arg[1]:lower())) – Oleg V. Volkov – 2016-02-24T16:10:44.830

@OlegV.Volkov Oh, thanks. Don't know why I did it this way... must have been tired... – Katenkyo – 2016-02-25T07:06:05.327

1

SpecBAS - 36 bytes

1 INPUT a$,b$: ?POS(UP$ a$,UP$ b$)=0

Returns 1 (True) if letter is NOT found, 0 (False) if it is. Converting to uppercase with UP$ save once character vs LOW$

Brian

Posted 2016-02-22T19:20:33.327

Reputation: 1 209

1

><> , 42 bytes

i:"a"(?\:i:0(?\= ?\70.
.18+" "/   ;n1/;n0/

Overview :

i:"a"(?\
.18+" "/

Grabs the first letter, adds space (32) to it if it's not lowercase


:i:0(?\
   ;n1/

Grabs the following letters from the input. It compares them to 0 in order to know if it has reached the end of the input, in which case i returns -1. In this case it will output 1 and stop.


= ?\70.
;n0/

Compare the current letter to the first one. If they're equal, output 0 and stop. Otherwise, jump back to the beginning of the loop.

You can give it a try on the online interpreter, it nicely illustrates the program flow.

Aaron

Posted 2016-02-22T19:20:33.327

Reputation: 3 689

0

C++14, 53 bytes

Based on Josh's answer

As unnamed lambda, assumes s to be std::string and c to be char:

[](auto s,auto c){return s.find(c)+s.find(c^32)==-2;}

Also assumes the length of the strings is below 2^31. If that may be the case, use the safer 58 byte variant:

[](auto s,auto c){return s.find(c)==-1&&s.find(c^32)==-1;}

Usage:

auto f =
  [](auto s,auto c){return s.find(c)+s.find(c^32)==-2;}
;

int main() {
  std::string a = "abcdfg";
  std::cout << f(a,'e') << std::endl;
  std::cout << f(a,'E') << std::endl;
  std::cout << f(a,'a') << std::endl;
  std::cout << f(a,'A') << std::endl;
}

Karl Napf

Posted 2016-02-22T19:20:33.327

Reputation: 4 131

0

C#, 52 51 bytes

(C,I)=>{return!I.ToLower().Contains(C.ToLower());};

If I could find a way to get rid of ToLower(), I'd save 16 bytes.

One of those cases where I can get rid of the space after return, yay.

Yodle

Posted 2016-02-22T19:20:33.327

Reputation: 2 378

C|32 makes ToUpper(), that way you could check I.ToUpper().Contains(C|32) – Karl Napf – 2016-11-23T17:57:45.030

Yeah I tried that route, but I'd have to cast to char and then convert that to a string with "" for Contains, which ends up being longer than just ToLower twice. – Yodle – 2016-11-23T18:00:38.433

0

GML, 66 bytes

return string_pos(string_lower(argument0),string_lower(argument1))

Timtech

Posted 2016-02-22T19:20:33.327

Reputation: 12 038

How does this take input? – a spaghetto – 2016-02-23T23:27:15.153

It's a function. – CalculatorFeline – 2016-02-24T01:38:54.597

In GML all scripts receive arguments in the form of argument0, argument1, etc. or as an argument[] array. They can return a value with return. – Timtech – 2016-02-24T22:44:39.013

0

Scala, 50 bytes

def f(s:String,c:Char)= !s.matches(s"(?i:.*$c.*)")

(Mostly derived from the Java answer)

gladed

Posted 2016-02-22T19:20:33.327

Reputation: 159

0

Groovy, 58 bytes

print args[1].toLowerCase().indexOf(args[0].toLowerCase())

Run with:

groovy filename.groovy *char* *string*

Xgongiveittoya

Posted 2016-02-22T19:20:33.327

Reputation: 111

0

Oracle SQL 11.2, 68 bytes

SELECT TRANSLATE(UPPER(:2),UPPER(:1)||UPPER(:2),UPPER(:1))FROM DUAL;

:1 is the char

:2 is the string

Return NULL/empty string as truthy, everything else is falsy.

It translates every character of the string :2 to nothing, which removes them, except for the :1 char.

Jeto

Posted 2016-02-22T19:20:33.327

Reputation: 1 601

0

DUP, 33 bytes

[`32~&a:0[\1-$;$][32~&a;=@|]#%%~]

Try it here.

Anonymous lambda that takes input from both argument and STDIN and leaves result on stack. Usage:

0"asdf"[`32~&a:0[\1-$;$][32~&a;=@|]#%%~]!

Explanation

[                                ] {lambda}
 `                                 {get STDIN char}
  32~&                             {uppercase (charcode representation)}
      a:                           {store to a}
        0                          {push 0 to stack as bool}
         [      ][          ]#     {while loop}
          \1-$;$                   {reduce from last string char:}
                  32~&               {uppercase}
                      a;=            {get a==[uppercase char]}
                          @|         {XOR result with bool}
                              %%~  {drop twice, negate TOS (bool)}

Mama Fun Roll

Posted 2016-02-22T19:20:33.327

Reputation: 7 234

0

Hoon, 61 56 bytes

|*
{a/* b/*}
(lien (trip (cuss b)) (cury test (cuss a)))

There are a couple reasons why this is so bad. Unfortunately, Hoon's uppercase/lowercase function is tape -> cord, so another ++trip call is needed from the result of cuss to turn it back into a list of characters. It also doesn't have a function to test if the list contains a value, only if a function returned yes on any entry.

Hoon has two syntaxs: wide-form and tall-form. Wide-form uses ()'s for grouping such as ?:(a b c), while tall-form uses whitespace (either two spaces or a newline) for seperation of twigs. Since newlines count as one byte, using tall-form after runes is smaller although it looks very silly and no one would write it like that.

This entry also abuses Hoon's generic system, wet gates. The |* rune is like |=, which creates a "function" except that it replaces the type signature with the type of the sample and typedchecks at the callsite instead of definition. Since |* and |= are the exact same length, but you can omit the type info for the function args, it's smaller to just let the caller provide the type information instead of having |= {a/tape b/tape}.

To call it, enter %+ in the Urbit :dojo, then this snippet, then "A" "You don't need to care about any non-alphabetic symbols." (two spaces between those strings!). This is simply a Hoon two-argument function call.

RenderSettings

Posted 2016-02-22T19:20:33.327

Reputation: 620

0

Elixir, 98 bytes

c = "e"
s = "This is a lipogram."

l=fn(c,s)->t=&to_char_list/1;d=&String.downcase/1;a=hd(t.(d.(c)));Enum.all? t.(d.(s)),&(&1!=a)end

IO.puts l.(c,s)

Save the to-char-list and down-case functions to variables, because we will have to call them each twice. Convert searched-for character and string to char lists, enumerate, and compare.

D. Doyle

Posted 2016-02-22T19:20:33.327

Reputation: 1

You aren't allowed to require users to define input manually. Maybe add a input() equivalent? – Rɪᴋᴇʀ – 2016-02-29T22:58:51.403

-1

Java, 51 bytes

return(!s.toLowerCase().contains(c.toLowerCase()));

Uses s as input and c as char, but c must be of type String.

fxk8y

Posted 2016-02-22T19:20:33.327

Reputation: 19