A newly discovered number: bleen!

44

6

"The Nobel Prize in mathematics was awarded to a California professor who has discovered a new number! The number is bleen, which he claims belongs between 6 and 7." --George Carlin

In this challenge, you will print all Integers, inclusive, within the given input range. Print numbers ascending or descending according to their input order. That is, for input [n1, n2], print ascending if n1 < n2, descending if n1 > n2.

Since bleen is now an Integer number it may be used as input. It must also be included in the output, between 6 and 7 where applicable. Also note that -bleen exists between -7 and -6.

Input

Two Integers [n1, n2] in the range [-10, 10], inclusive, via your programming language's input of choice.

(Input may also contain bleen and -bleen!)

Output

Print all Integers starting at n1 and ending with n2, including the newly discovered bleen between 6 and 7. Output can be a range of character separated numbers in some form your language supports - that is, comma or space separated. One trailing space of output is okay.

Examples

Input:  1 10
Output: 1 2 3 4 5 6 bleen 7 8 9 10 

Input:  -9 -4
Output: -9 -8 -7 -bleen -6 -5 -4

Input:  -8 bleen
Output: -8 -7 -bleen -6 -5 -4 -3 -2 -1 0 1 2 3 4 5 6 bleen

Input:  9 1
Output: 9 8 7 bleen 6 5 4 3 2 1

Input:  2 -bleen
Output: 2 1 0 -1 -2 -3 -4 -5 -6 -bleen

Input:  -bleen 0
Output: -bleen -6 -5 -4 -3 -2 -1 0

Input:  bleen bleen
Output: bleen

Input:  2 2
Output: 2

Additional notes

You may write a program or function and use any standard method of receiving input and providing output.

You may use any programming language, but standard loopholes are not allowed.

This is , so the shortest valid answer – measured in bytes – wins.

CzarMatt

Posted 2016-08-03T17:34:01.937

Reputation: 1 769

Can output be prefixed and postfixed, i.e. [1 2 3 4 5 6]? – Leaky Nun – 2016-08-03T17:37:55.513

@LeakyNun Sure! – CzarMatt – 2016-08-03T17:38:36.513

16Is bleenteen between 16 and 17 also? (and is bleenty-bleen between bleenty-six and bleenty-seven?) – Joffan – 2016-08-03T18:07:55.510

5@Joffan ... and bleenty between 60 and 70? – Adám – 2016-08-03T18:08:35.750

@Adám - exactly, and so on... – Joffan – 2016-08-03T18:09:53.423

5@Joffan How much is (bleen + 7) / 2 ? – Adám – 2016-08-03T18:10:35.877

1@Adám it is just possible that we are overthinking this :-) – Joffan – 2016-08-03T18:11:48.367

3

According to #2 here, this is perfectly possible in a notation of base eleven, where 6₁₁ = 6₁₀, bleen₁₁ = 7₁₀, 7₁₁ = 8₁₀, 8₁₁ = 9₁₀, 9₁₁ = 10₁₀, 10₁₁ = 11₁₀.

– Adám – 2016-08-03T18:15:01.673

(bleen₁₁ + 7₁₁) / 2 = bleen.555…₁₁ = 7.5₁₀ – Adám – 2016-08-03T18:22:06.080

Newline separators are not allowed? – Value Ink – 2016-08-03T19:17:52.497

10In mathematics there is only the Field's medal, no Nobel Prizes there.... – Graipher – 2016-08-04T07:48:09.000

8@Graipher That's why you shouldn't rely on a comedian's standup bit as hard news ;) – Geobits – 2016-08-04T09:45:17.190

3@Geobits Wait, this new number is not real? But I just modified all the code I ever wrote to be in base 11... – Graipher – 2016-08-04T09:48:38.787

1@Graipher I never said it wasn't real. The part about the Nobel Prize probably wasn't though. Keep your modified code as-is :P – Geobits – 2016-08-04T09:51:20.487

1@Graipher: the Abel prize is a slightly closer analogue to the Nobel prize. – Steve Jessop – 2016-08-04T10:45:09.557

Was hoping for a bigger skit or context for Carlin and bleen. Here it is https://youtu.be/YHFLTb9Fp18?t=4m35s

– goodguys_activate – 2016-08-04T13:18:42.160

4

So apparently Derf isn't the only newly established number... 1, 2, 3, 4, 5, derf, 6, bleen, 7, 8, 9, 10

– Patrick Roberts – 2016-08-05T00:30:22.787

@PatrickRoberts There's also Gird between three and four: 1, 2, 3, gird, 4, 5, derf, 6, bleen, 7, 8, 9, 10

– Steadybox – 2017-06-15T20:13:43.290

Answers

12

Python 3, 132 130 bytes

r=round
bleen=6.1
m=1.08
a,b=eval(input())
d=1-2*(a>b)
print(*[[r(i/m),"-bleen"[i>0:]][i*i==49]for i in range(r(m*a),d+r(m*b),d)])

Takes input in the following example format:

-8, bleen

orlp

Posted 2016-08-03T17:34:01.937

Reputation: 37 067

Does this work outside of [-10,10]? – mbomb007 – 2016-08-03T21:33:31.540

@mbomb007 Nope. – orlp – 2016-08-03T21:33:52.240

Very ingenious solution with bleen and eval there, nice one. Another suggestion: use bleen=7/m for clearification without character penalty – WorldSEnder – 2016-08-03T23:32:40.747

@orlp is there a reason you named the variable bleen and not just a single digit char? – Blue – 2016-08-04T07:46:53.140

@muddyfish Yes, it's necessary for the eval to translate bleen into the correct value. – orlp – 2016-08-04T08:01:03.983

Ohh... Thats really clever! – Blue – 2016-08-04T08:47:44.347

9

Ruby, 114 100 98 bytes

Input is an array with [n1, n2]. (If it must be two seperate arguments, +1 byte to change the function arg from g to *g. Bleen must be a string, "bleen". Outputs an array of the range. Suggested by @Jordan with his (?) initial version granting -7 bytes, but I also golfed off 7 more after that.

Try it online.

->g{a=*-10..-7,?-+b='bleen',*-6..6,b,*7..10;x,y=g.map{|v|a.index v}
y<x ?a[y..x].reverse: a[x..y]}

Original full program version that reads input from ARGV:

b='bleen'
a=[*-10..-7,?-+b,*-6..6,b,*7..10].map &:to_s
x,y=$*.map{|v|a.index v}
puts y<x ?a[y..x].reverse: a[x..y]

Value Ink

Posted 2016-08-03T17:34:01.937

Reputation: 10 608

If you make this a lambda you can get rid of .map &:to_s and save 6 bytes, and you can save one more by changing the initialization of a to a=*-10..10;a[4,0]=?-+b;a[18,0]=b. – Jordan – 2016-08-03T20:12:10.117

I.e. ->*g{b='bleen';a=*-10..10;a[4,0]=?-+b;a[18,0]=b;x,y=g.map{|v|a.index v};puts y<x ?a[y..x].reverse: a[x..y]} – Jordan – 2016-08-03T20:14:12.440

@Jordan thanks. Didn't need to use the slicing trick to insert the bleen, though; my array composition is still shorter by about 1 byte. – Value Ink – 2016-08-03T20:40:59.913

Ah, I was counting the brackets; forgot you could omit them. – Jordan – 2016-08-03T20:43:37.000

Should I upvote, or leave you at exactly 4k? – NoOneIsHere – 2016-08-31T01:10:46.760

@NoOneIsHere lol fire away, it's going to break eventually anyhow – Value Ink – 2016-08-31T01:43:31.210

8

Pyth, 35 bytes

K++L\-P_J++`M7"bleen"`M}7TJ@LK}FxLK

Test suite.

The first part, i.e. K++L\-P_J++`M7"bleen"`M}7TJ, generates this array:

['-10', '-9', '-8', '-7', '-bleen', '-6', '-5', '-4', '-3', '-2', '-1', '0', '1', '2', '3', '4', '5', '6', 'bleen', '7', '8', '9', '10']

and then stores it in K.

The second part, i.e. @LK}FxLK, finds the sublist indicated by the input.

Leaky Nun

Posted 2016-08-03T17:34:01.937

Reputation: 45 011

1I thought of such an approach too. Mure interesting if we had to take any int range... – Adám – 2016-08-03T18:56:16.173

... and especially if we had to include bleenteen, and bleenty, etc. – Adám – 2016-08-03T18:57:00.143

8

Python 3, 157 145 123 108 115 139 161 158 153 bytes

Saved 22 thanks to Lynn. 17 saved thanks to shooqie. 3 saved thanks to ljeabmreosn. 5 saved thanks to Geoff Reedy.

a,b=eval(input())
s='-'
c='bleen'
d=a<b
l=list(map(str,range(-10,11)))[::[-1,1][d]]
x=l.insert
y=l.index
x(4,d*s+c)
x(18,(1^d)*s+c)
print(l[y(a):y(b)+1])

Input like '-10', '8'. Tips are welcome for a beginner.

Added 7 to account for -bleen. Added 15 to account for reversed input like '8','-10'. Added a large 21 to account for the reversed input signs for bleen vs -bleen.

Justin

Posted 2016-08-03T17:34:01.937

Reputation: 417

2l.index('-6') and l.index('7') should just be constants, no? – Lynn – 2016-08-03T19:25:30.593

Good point, I'll add that in... – Justin – 2016-08-03T19:26:27.787

2l=[str(i)for i in range(-10,11)] -> l=list(map(str,range(-10,11))) – shooqie – 2016-08-03T19:31:37.800

2Though I'm not sure why you need strings in the first place. l=list(range(-10,11)) works as well – shooqie – 2016-08-03T19:32:47.940

2Lines 2, 4, 5 can be replaced with for i in(4,18):l.insert(i,'bleen'). – shooqie – 2016-08-03T19:34:19.083

1@shooqie The for loop is missing the negative sign at index 4. e.g. the list contains two elements of 'bleen' rather than a '-bleen','bleen' – Justin – 2016-08-03T19:44:40.353

1Does it work for input 'bleen' or '-bleen'? – edc65 – 2016-08-03T19:49:36.120

1@edc65 it should now, input should now be in string form rather than int form – Justin – 2016-08-03T19:52:32.120

@JustinTervay instead of s=['-',' '], use s='- ' – ljeabmreosn – 2016-08-03T20:12:50.790

@JustinTervay: code doesn't work because you're looking for a number in a list, but it's a list of strings; use l=list(range(-10,11))[::[-1,1][a<b]] (which is shorter, too!) – shooqie – 2016-08-03T20:14:39.080

@shooqie Works for me. My input is '-8','8'. Make sure you have the apostrophes. Your code won't work for cases where the input is 'bleen', 8. Also using s='- ' leaves a space in front of positive bleen, which isn't in the challenge and I'm picky. Note that my s=['-',''], the second part is just an empty string, not a space. – Justin – 2016-08-03T20:18:06.000

OK, I get it now. Still, having to include these apostrophes seems like a really dirty workaround to me. – shooqie – 2016-08-03T20:21:13.140

@JustinTervay add d=a<b and replace s=['-',''] with s='-'. Then replace s[a>b] with d*s, replace [a<b] with [d] and s[a<b] with (1^d)*s. That should save 3 bytes. – ljeabmreosn – 2016-08-03T20:38:29.610

you can save a few bytes by adding x=l.insert and y=l.index and replacing those occurrences by the variables – Geoff Reedy – 2016-08-03T22:16:30.657

This doesn't work for me with the input '-2', '-9' (outputs an empty list, because '-2'<'-9' == True) – WorldSEnder – 2016-08-03T23:06:12.653

@WorldSEnder good catch, unsure how to fix in a short/concise manner – Justin – 2016-08-03T23:27:30.437

3

Ruby, 141 bytes

->*a{
l="bleen"
s=13
a,b=a.map{|n|2*n rescue s*(n<=>?b)}
b,a,r=a,b,1if b<a
o=(a..b).map{|n|n==s ?l:n==-s ??-+l:n/2}.uniq
puts r ?o.reverse: o}

Ungolfed

lambda do |*args|
  bleen = "bleen"
  subst = 13 # This will stand in for "bleen"

  a, b = args.map {|arg|
    begin
      # Double the number
      2 * arg
    rescue
      # It wasn't a number, so it's "bleen" or "-bleen"; replace it with 13 or -13
      subst * (arg <=> "b")
    end
  }

  if b < a
    # If the range isn't ascending, reverse it and remember that we did
    b, a, reverse = a, b, 1
  end

  # Step through the range, replacing 13 and -13 with "bleen" and "-bleen" and
  # halving everything else
  result = (a..b).map {|n|
    if n == subst
      bleen
    elsif n == -subst
      "-" + bleen
    else
      n / 2
    end
  }.uniq # Drop duplicates

  # Reverse the result if the range was descending
  puts reverse ? result.reverse : result
end

Jordan

Posted 2016-08-03T17:34:01.937

Reputation: 5 001

3

Batch, 239 186 bytes

@set/ableen=1431655772,a=%1*3,b=%2*3,c=b-a^>^>31^|1
@for /l %%i in (%a%,%c%,%b%)do @((if %%i==20 echo bleen)&(if %%i==-20 echo -bleen)&set/aj=%%i%%3,k=%%i/3&cmd/cif %%j%%==0 echo %%k%%)

Works by looping from 3*%1 to 3*%3 and then dividing by three and printing the numbers with no remainder, however setting bleen to that magic number causes integer overflow and the value 20 is used instead. This is then printed out at the appropriate point in the loop.

Neil

Posted 2016-08-03T17:34:01.937

Reputation: 95 035

@edc65 When was the last time I read a question correctly first time... – Neil – 2016-08-03T20:18:48.347

@edc65 oh, and I forgot -bleen too. Bah. – Neil – 2016-08-03T20:22:12.643

Tried it but no output. Usage example? – edc65 – 2016-08-03T20:51:25.717

@edc65 bleen.bat bleen -bleen perhaps? – Neil – 2016-08-03T20:59:19.123

No output, as I said. Is it dos/windows bat language? I use Windows 10 – edc65 – 2016-08-03T21:05:23.827

@edc65 Works for me in both Windows XP and Windows 10. – Neil – 2016-08-03T21:26:46.360

3

JavaScript (ES6), 158

Nice challenge, hard to golf. Probably the range methods used in Python and Ruby answers could score better even in JS.

(a,b)=>(c=x=>x<-6?x-1:x>6?x+1:1/x?x:x<'b'?-7:7,a=c(a),b=c(b),d=b>a?1:-1,a-=d,e=x=>x-7?x-(x>7):'bleen',[...Array(d*(b-a))].map((x=a+=d)=>x<0?'-'+e(-x):e(x)))  

Less golfed

(a,b)=>(
  c=x=>x<-6?x-1:x>6?x+1:1/x?x:x<'b'?-7:7,
  a=c(a),b=c(b),
  d=b>a?1:-1,
  a-=d,
  e=x=>x-7?x-(x>7):'bleen',
  [...Array(d*(b-a))].map((x=a+=d)=>x<0?'-'+e(-x):e(x))
)  

Test

f=(a,b)=>(c=x=>x<-6?x-1:x>6?x+1:1/x?x:x<'b'?-7:7,a=c(a),b=c(b),d=b>a?1:-1,a-=d,e=x=>x-7?x-(x>7):'bleen',[...Array(d*(b-a))].map((x=a+=d)=>x<0?'-'+e(-x):e(x)))  

function go(){
  var a=A.value,b=B.value
  // make them numeric if possible
  a=isNaN(a)?a:+a
  b=isNaN(b)?b:+b
  
  O.textContent=f(a,b)
}  
go()
A <select id=A onchange='go()'>
<option>-10<option>-9<option>-8<option>-7<option>-bleen<option>-6<option>-5<option>-4<option>-3<option>-2<option>-1<option>0
<option>1<option>2<option>3<option>4<option>5<option>6<option>bleen<option>7<option>8<option>9<option>10
</select>
B <select id=B onchange='go()'>
<option>-10<option>-9<option>-8<option>-7<option>-bleen<option>-6<option>-5<option>-4<option>-3<option>-2<option>-1<option>0
<option>1<option>2<option>3<option>4<option>5<option>6<option>bleen<option>7<option>8<option>9<option selected>10
</select>
<pre id=O></pre>

edc65

Posted 2016-08-03T17:34:01.937

Reputation: 31 086

I think you missed -6. – betseg – 2016-08-03T21:11:58.843

3

Swift 2.2, 342 Bytes

func a(x:String,y:String){var k="bleen",a=Int(x) ?? (x==k ?(x==y ? -9:6):-6),b=Int(y) ?? (y==k ?6:-6),t=0,s=[Any](),f=Int(x)==nil ?x:"";if a>b{t=a;a=b;b=t};for i in a...b{if i==7 && a != 7{s.append(k)};s.append(i);if -i==7 && b != -7{s.append("-"+k)}};for v in t==0 ?s:s.reverse(){f+=" \(v)"};if Int(y)==nil&&b>0{f+=" \(y)"};print(x==y ?x:f)}

Test this using IBM's Swift Sandbox

Ungolfed

func bleen(x: String, y: String){
    var k = "bleen",
        a = Int(x) ?? (x == k ? (x == y ? -9 : 6) : -6),
        b = Int(y) ?? (y == k ? 6: -6),
        t = 0,
        s = [Any](),
        f = Int(x) == nil ? x : ""

    if a > b{
        t = a
        a = b
        b = t
    }

    for i in a...b{
        if i == 7 && a != 7{s.append(k)}
        s.append(i)
        if -i == 7 && b != -7{s.append("-" + k)}
    }

    if Int(y) == nil && b > 0{s.append(y)}

    for v in t == 0 ? s : s.reverse(){
        f+="\(v) "
    }

    print(x == y ? x : f)
}

Jojodmo

Posted 2016-08-03T17:34:01.937

Reputation: 1 569

2

Python 3, 126 bytes

Input is in the form -5, 'bleen'

l=list(range(-10,11))
c='bleen'
s=l.insert
t=l.index
s(4,'-'+c)
s(18,c)
i,j=map(t,eval(input()))
d=1-2*(i<j)
print(l[i:j+d:d])

WorldSEnder

Posted 2016-08-03T17:34:01.937

Reputation: 179

2

Java, 271 bytes

int p(String w){if(w.contains("b"))return w.length()<6?7:-7;int i=Integer.decode(w);return i<-6?i-1:i>6?i+1:i;}void b(String s,String f){Integer l=p(s),r=p(f);for(r+=l<r?1:-1;l!=r;l-=l.compareTo(r))System.out.print(l==-7?"-bleen ":l==7?"bleen ":l+(l<-7?1:l<7?0:-1)+" ");}

Ungolfed with test cases:

class Bleen {
     static int p(String w) {
         if(w.contains("b"))
             return w.length() < 6 ? 7 : -7;
         int i = Integer.decode(w);
         return i < -6 ? i-1 : i>6 ? i+1 : i;
     }

     static void b(String s, String f) {
         Integer l = p(s), r = p(f);
         for(r += l<r ? 1 : -1; l != r; l -= l.compareTo(r))
             System.out.print(l == -7 ? "-bleen " : l == 7 ? "bleen ": l+(l < -7 ? 1 : l<7 ? 0 : -1)+" ");
     }

     public static void main(String[] args) {
         b("1","10"); System.out.println();
         b("-9","-4"); System.out.println();
         b("-8", "bleen"); System.out.println();
         b("9", "1"); System.out.println();
         b("2", "-bleen"); System.out.println();
         b("-bleen", "0"); System.out.println();
         b("bleen", "bleen"); System.out.println();
         b("2", "2"); System.out.println();
     }
}

Call b(start, end). Because the parameters are strings, it takes a lot of space to convert those into ints. Essentially the program treats 7 & -7 as bleen and -bleen.

user55852

Posted 2016-08-03T17:34:01.937

Reputation:

1

Nice answer, +1. Was pretty hard to come up with something to golf you answer, but I did. ;) Your method p can be changed to the following to save 6 bytes: int p(String w){int x=w.length(),i;if(x>3)return x<6?7:-7;i=Integer.decode(w);return i<-6?i-1:i>6?i+1:i;}. Also, you might want to state this is Java 7 and perhaps add an ideone.

– Kevin Cruijssen – 2016-08-04T08:26:03.777

Also, I've been able to make a shorter variant in Java 7 based on @LeakyNun's approach of first creating the complete list.

– Kevin Cruijssen – 2016-08-04T09:07:21.900

2

Java 7, 251 bytes

import java.util.*;String b(Object...a){String q="bleen",r="";List l=new ArrayList();int j=-10,i,z,y,t;while(j<11)l.add(j++);l.add(4,"-"+q);l.add(18,q);z=l.indexOf(a[0]);y=l.indexOf(b[1]);if(y<z){t=z;z=y;y=t;}for(i=z;i<=y;)r+=l.get(i++)+" ";return r;}

Different approach which is shorter than the already existing Java 7 answer.
Also, it's unfortunate that the parameters are potentially not in order, which adds some bytes to swap them around.

Ungolfed & test cases:

Try it here.

import java.util.*;
class Main{
  static String b(Object... a){
    String q = "bleen",
           r = "";
    List l = new ArrayList();
    int j = -10, i, z, y, t;
    while(j < 11){
      l.add(j++);
    }
    l.add(4, "-"+q);
    l.add(18, q);
    z = l.indexOf(a[0]);
    y = l.indexOf(a[1]);
    if(y < z){
      t = z;
      z = y;
      y = t;
    }
    for(i = z; i <= y; ){
      r += l.get(i++) + " ";
    }
    return r;
  }

  public static void main(String[] a){
    System.out.println(b(1, 10));
    System.out.println(b(-9, -4));
    System.out.println(b(-8, "bleen"));
    System.out.println(b(9, 1));
    System.out.println(b(2, "-bleen"));
    System.out.println(b("-bleen", 0));
    System.out.println(b("bleen", "bleen"));
    System.out.println(b(2, 2));
  }
}

Output:

1 2 3 4 5 6 bleen 7 8 9 10 
-9 -8 -7 -bleen -6 -5 -4 
-8 -7 -bleen -6 -5 -4 -3 -2 -1 0 1 2 3 4 5 6 bleen 
1 2 3 4 5 6 bleen 7 8 9 
-bleen -6 -5 -4 -3 -2 -1 0 1 2 
-bleen -6 -5 -4 -3 -2 -1 0 
bleen 
2 

Kevin Cruijssen

Posted 2016-08-03T17:34:01.937

Reputation: 67 575

2

Scala, 223 bytes

object B extends App{val b="bleen"
val L=((-10 to -7)++List(s"-$b")++(-6 to 6)++List(b)++(6 to 10)).map(""+_)
val Array(s,e)=args.map(L.indexOf(_))
println((if(s<=e)L.slice(s,e+1)else L.slice(e,s+1).reverse).mkString(" "))}

Tim Robbins

Posted 2016-08-03T17:34:01.937

Reputation: 41

2

JavaScript (ES6), 178 bytes

 (s,e)=>{q='bleen';t=[];for(i=-10;i<11;i++)t.push(i);t.splice(4,0,'-'+q);t.splice(18,0,q);s=t.indexOf(s);e=t.indexOf(e);s>e&&t.reverse()&&(e=22-e)&&(s=22-s);return t.slice(s,e+1)}

Try it

EDIT: Fix for reverse ordering.Thanks Patrick, missed this condition

FZysset

Posted 2016-08-03T17:34:01.937

Reputation: 21

2

R, 110 107 bytes

Thanks to Cyoce for golfing 3 bytes.

a=function(x,y){e=c(-10:-7,"-bleen",-6:6,"bleen",6:10)
b=function(d)which(e==as.character(d))
e[b(x):b(y)]}

Builds the whole list in order, picks out the relevant ones. Function in the middle named "b" seemed the easiest way to make that happen. Apply,etc

user5957401

Posted 2016-08-03T17:34:01.937

Reputation: 699

Is all that whitespace required? – Cyoce – 2016-08-24T00:01:18.207

No, and usually I wouldn't have had it. Thanks! Edit: I didn't even count much of it. Must have been half asleep. – user5957401 – 2016-08-24T13:41:20.287

1

Javascript (using external library) (343 bytes)

(a,b)=>{r="bleen";s="-"+r;c=d=>d==r?7:(d==s?-7:d);i=c(a);j=c(b);m=Math.min(i,j);n=Math.max(i,j);w=i<=j?_.RangeTo(i,j):_.RangeDown(i,Math.abs(j-i)+1);g=i<j?6:7;if(n>-7&&m<-6){w=w.InsertWhere("-bleen",x=>x==-7)}if(m<8&&n>6){w=w.InsertWhere("bleen",x=>x==g)}if(a==r||b==r){w=w.Where(x=>x!=7)}if(a==s||b==s){w=w.Where(x=>x!=-7)}return w.ToArray()}

Link to lib: https://github.com/mvegh1/Enumerable

Screenshot:

enter image description here

applejacks01

Posted 2016-08-03T17:34:01.937

Reputation: 989

-1

Python 2, 100 bytes

The first four lines generate the list [-10, -9, -8, -7, 'bleen', -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 'bleen', 7, 8, 9, 10]. The next line gets input and stores it in s and e. The last two lines use .index() and list slicing notation to get the correct range.

a=range(-10,11)
b="bleen"
c=a.insert
c(17,b)
c(4,b)
s,e=eval(input())
d=a.index
print a[d(s):d(e)+1]

Works in the same way as Leaky Nun's answer but developed independently. Stole an input method from orlp.

Ungolfed:

array = range(-10, 11)
array.insert(17, "bleen")
array.insert(4, "bleen")
start, end = eval(input())
print array[array.index(start):array.index(end) + 1]

noɥʇʎԀʎzɐɹƆ

Posted 2016-08-03T17:34:01.937

Reputation: 1 316

This is incorrect - the number between -7 and -6 is -bleen, not bleen. Though we have found a new number, the basic rules of algebra must remain constant: 0 is the only number that is its own additive inverse, by virtue of being the additive identity element. Furthermore, eval(input()) is just input() in Python 2. – Mego – 2016-08-05T00:28:07.630

@Mego oh, oops.... – noɥʇʎԀʎzɐɹƆ – 2016-08-05T00:37:34.477