Billions of Booleans


#1

Error Message:

(ruby):7: unterminated regexp meets end of file

What am I missing - I can not fix it

thanks

# test_1 should be true
test_1 = (3 == 3) && (4 == 4)

# test_2 = should be true
test_2 = (1 == 3) || (3 == 3)

# test_3 = should be false
test_3 = !(1 == 1) // (2 == 3)

end

#2

Hi, @andrewmc1974 ,

What's // doing here? ...

test_3 = !(1 == 1) // (2 == 3)

#3

test_1 should be true

test_1 =(3==3) && (4==4) // true

test_2 = should be true

test_2 =(1==3) || (3==3) // true

test_3 = should be false

test_3 =!(1==1) || (2==3) // false

I dont know - but I still can not see where I have gone wrong. Its obviously something fundamental and obvious and I do not know what it is - I can not see it


#4

In your original post, where you had ...

test_3 = !(1 == 1) // (2 == 3)

... did you actually intend to have this? ...

test_3 = !(1 == 1) || (2 == 3)

#5

yes, but I still do not know what I have done wrong

thanks


#6

The // that you had here was interpreted as being part of what is known as a regular expression, which is used to work with matching text ...

test_3 = !(1 == 1) // (2 == 3)

Instead of //, you needed a || operator.


#7

thanks for this

test_1 should be true

test_1 =(3==3) && (4==4) // true

test_2 = should be true

test_2 =(1==3) || (3==3) // true

test_3 = should be false

test_3 =!(1==1) || (2==3) // false

end

the error still reads:

(ruby):7: unterminated regexp meets end of file

i am baffled


#8

@andrewmc1974 ,

You need to remove the following from the ends of each of the three lines where they occur ...

// true

// true

// false

#10

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.