BFBIGTHN - "If Bigger than" in BF
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).
|
|
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 :-)
|
|
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.
|
|
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
|
|
Jander:
2013-01-09 15:56:09
@Mostafa: An interesting challenge :-)
|
|
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 ^_^ |