BFBIGTHN - "If Bigger than" in BF

no tags 


Brainf*** is a Turing complete language...
what ever the arithmatic/logic operation other langs like C or LISP can do ...BF can do it also !

your task is to write a BF code to test if a is Bigger Than b ..

Input:


tow_digit_number t (number of test cases)followed by end_of_line charachter


then t lines each of them contains:


    tow_digit_number a
    followed by space
    then tow_digit_number b
    followed by ASCII(10) (End of line).


(at the end of the file there is EOF charachter which value is (-1))

output:


the logic value of (a > b) for each test case

(don't forget to print any space after each output such like '\n' or '\t' or space' ')

Example:


inputs:


09
41 92
99 40
01 20
23 00
00 01
20 30
00 09
99 00
11 12

outputs:


0
1
0
1
0
0
0
1
0

    BE CAREFUL: ONLY BRAINF*** AVAILABLE FOR SUBMIT .
    
ENJOY ;)

Note : maybe it will be helpful for you to know that a never equal to b in the test cases ;)


hide comments
Sushovan Sen: 2017-03-18 23:22:50

@Mostafa: Can you please check where my solution gives WA? Every case runs fine on ideone.

Sandeep Garhwar: 2017-02-17 14:52:22

@Mitch Schwartz: probably a late reply, but I realize my mistake. I was naive back then.

Last edit: 2017-04-02 11:46:28
Mitch Schwartz: 2014-06-02 10:20:30

@Sandeep Garhwar: Congrats on getting down to 67 quite quickly! I prefer to keep the comments section generally clean from hints. (But I usually only moderate the more serious cases.) I deleted your previous comment here and censored your comment on TSET because I felt they gave too much away. Please allow people to think on their own. To me, giving such hints is like shouting answers to someone quietly working on a crossword puzzle, very rude and disrespectful (and I've written about it elsewhere).

That said, I do sometimes give (vague) hints, and you could drop by the IRC channel if you want to discuss the problem a bit; Jander is frequently signed in there as well. It may be obvious, but: you may not get an immediate reply on IRC; people could be asleep or away from their computers.

Last edit: 2014-06-02 10:53:33
Sandeep Garhwar: 2014-06-02 09:11:10

Clueless after 67 bytes,anyone care dropping a hint?

Jander: 2013-01-11 07:29:09

@Mitch - heh :-)

I suspect you get the same; I just had a gut feeling that there was a more efficient way than my 65 byte version, so kept looking at it. I had the same feeling for BFPRIME. I don't think that there's any more that can be done for this challenge, but I may be proved wrong ...

Last edit: 2013-01-11 07:29:46
Mitch Schwartz: 2013-01-11 01:36:32

@Jander: 61 bytes, that's great! It should provide an enjoyable "pulling out all my hair to find out how it's done" experience.

Jander: 2013-01-10 11:17:11

@Mitch - My pleasure :-) I tend to keep my focus solely on SHORTEN, otherwise I could spend far far too much time doing these challenges, so thanks for suggesting this one be put there. I'd avoided the BF ones for ages, but I'm kinda fond of the language now.

I also had an earlier version of my current code that was a little longer and all I had to do was cut that chunk out and it still worked.

Mitch Schwartz: 2013-01-10 08:53:34

"I always feel bad when one of my programs can be improved purely by deletion. It's happened five or ten times I think." - Daniel B. Cristofani

Here I just needed to delete three bytes; it's happened to me several times before too! Congrats Jander, and thanks for joining in :).

Jander: 2013-01-09 15:56:09

@Mostafa: An interesting challenge :-)

Annoyingly I've had to swap all the <>'s to ><'s as I've hit one of the bugs in bff that Mitch highlighted to its author. That kinda messes with my mind due to the way I think/code in BF.

Mostafa 36a2: 2013-01-09 15:26:11

@Jander: You Welcome at the Top of Score list ...


Added by:Mostafa 36a2
Date:2012-12-27
Time limit:1s-5s
Source limit:2000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:BF
Resource:BF it self ^_^