SBSTR1 - Substring Check (Bug Funny)

no tags 

Given two binary strings, A (of length 10) and B (of length 5), output 1 if B is a substring of A and 0 otherwise.

Please note, that the solution may only be submitted in the following languages: Brainf**k, Whitespace and Intercal.

Input

24 lines consisting of pairs of binary strings A and B separated by a single space.

Output

The logical value of: 'B is a substring of A'.

Example

First two lines of input:

1010110010 10110
1110111011 10011

First two lines of output:
1
0


hide comments
:D: 2012-06-27 06:18:42

It's a problem for esoteric languages. It's medium difficulty with those but trivial with standards like C++ or pascal. It wouldn't make sense to add more.

Last edit: 2012-12-12 20:19:09
Pascual Madrid: 2012-06-27 03:51:03

Why canĀ“t use another languajes?

Alex Anderson: 2012-04-30 21:55:20

Man, it is really really annoying that this bff interpreter sucks.

Relevant information: negative number at pointer followed by [-] = roughly infinite loop
Between the end of one B and the start of another A, there is exactly 1 character.

Last edit: 2012-04-30 23:01:30
blashyrkh: 2011-12-17 12:11:10

Is there any garbage in the input lines after string B?

Ignacio Cortorreal: 2011-12-08 15:16:51

You should organize your input in a quick way to be processed. This tutorial was helpful: http://nieko.net/projects/brainfuck

I believe that a processor capable of only these operations should be very cheap indeed.

frankson.zhu: 2011-08-16 04:57:20

I agree with gzc, as to me, I don't any of these programming languages.

gzc: 2011-07-15 10:09:09

I wonder who are using Brainfuck,Whitespace,Intercal.You can go to topdesignmag.com and read《Top 13 Most Absurd Programming Languages》

Craig H: 2010-05-06 22:59:39

Warning, bff-1.0.3.1 uses signed numbers so if after subraction a number goes negative you can't get to zero using -.
My suggestion is to debug using bff-1.0.3.1 to catch this problem


Added by:adrian
Date:2004-05-01
Time limit:1s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:BF ICK WHITESPACE