00:00:11 To fill the daily Perl quota - functional programming in Perl: perl -e 'print &{&{sub { my $f = shift; return &$f($f); }}(sub { my $f = shift; return sub { my $n = shift; return 1 if $n < 2; return &{&$f($f)}($n-1) + &{&$f($f)}($n-2); }; })}(8), "\n";' 00:00:27 I think that means it's time to go to sleep. 00:00:39 LOL 00:00:42 Brilliant 00:12:35 -!- kipple has quit (Read error: 110 (Connection timed out)). 00:16:08 -!- graue has joined. 00:19:21 -!- graue has quit (Client Quit). 00:29:16 -!- CXI has joined. 01:26:27 -!- GregorR has quit (Remote closed the connection). 01:26:35 -!- GregorR has joined. 01:58:46 -!- GregorR has quit (Remote closed the connection). 01:58:50 -!- GregorR_ has joined. 02:25:12 -!- GregorR_ has quit (Remote closed the connection). 02:25:45 -!- GregorR_ has joined. 02:27:34 -!- GregorR_ has quit (Remote closed the connection). 02:27:50 -!- GregorR_ has joined. 02:28:45 -!- GregorR_ has quit (Remote closed the connection). 02:29:17 -!- GregorR_ has joined. 02:39:08 -!- GregorR__ has joined. 02:43:07 -!- GregorR__ has quit (Remote closed the connection). 02:43:38 -!- GregorR__ has joined. 02:54:02 -!- GregorR__ has quit (Remote closed the connection). 02:54:38 -!- GregorR__ has joined. 03:03:49 -!- GregorR__ has changed nick to GregorR. 04:37:32 -!- Arrogant has joined. 04:41:33 -!- Sgeo has quit. 05:12:35 -!- CXI has quit (Connection timed out). 05:57:45 -!- GregorR__ has joined. 05:58:03 -!- GregorR has quit (Remote closed the connection). 06:10:51 -!- GregorR__ has quit (Remote closed the connection). 06:13:55 -!- GregorR___ has joined. 06:16:31 -!- GregorR__ has joined. 06:16:34 -!- GregorR__ has quit (Remote closed the connection). 06:18:57 -!- GregorR___ has quit (Remote closed the connection). 06:19:04 -!- GregorR___ has joined. 06:19:20 -!- Arrogant has quit ("Leaving"). 06:27:33 -!- GregorR___ has quit (Remote closed the connection). 06:27:46 -!- GregorR___ has joined. 07:04:20 -!- GregorR____ has joined. 07:05:45 -!- GregorR___ has quit (Remote closed the connection). 07:33:07 -!- calamari has quit ("Leaving"). 07:59:59 -!- clog has quit (ended). 08:00:00 -!- clog has joined. 08:07:14 -!- GregorR____ has changed nick to GregorR. 08:59:05 -!- GregorR has quit (Remote closed the connection). 08:59:15 -!- GregorR has joined. 09:13:14 -!- GregorR has quit (Remote closed the connection). 09:13:20 -!- GregorR has joined. 09:34:21 -!- SimonRC has quit (Remote closed the connection). 09:35:08 -!- SimonRC has joined. 11:07:06 -!- GregorR__ has joined. 11:07:24 -!- GregorR has quit (Remote closed the connection). 11:09:21 -!- kipple has joined. 11:19:05 -!- GregorR__ has quit (Remote closed the connection). 11:20:56 -!- GregorR__ has joined. 11:30:41 -!- GregorR__ has quit (Remote closed the connection). 13:40:46 -!- Keymaker has joined. 13:41:24 oh my head.. what is this place? where am i?! this looks strangely familiar.. 13:59:08 -!- kipple has quit (Read error: 110 (Connection timed out)). 14:01:17 -!- kipple has joined. 14:33:55 -!- jix has joined. 14:35:37 hello jiz 14:35:39 *x 14:35:57 any new language areund? 14:40:49 no 14:41:57 ok 15:02:19 -!- jix has quit (" HydraIRC -> http://www.hydrairc.com <- IRC has never been so good"). 15:31:59 -!- cyph1e has joined. 15:33:10 Hi, can anyone give me an advice for writing a brainfuck program which increases a 3 digit input (seen as a number) by one? 15:33:38 like 123 -> 124, 879 -> 880 15:35:46 yeah 15:35:49 and hi 15:36:16 what kind of advice you want? 15:36:19 tips or code? 15:36:30 the way I would do it: increase the last digit by one. test if the new number is 58 (ascii value of ':'). If not, then done. else replace with 48 and repeat the procedure for next digit 15:37:07 yeah 15:37:21 but you didn't specify how the number is input, so it might not apply 15:37:35 three digit input 15:37:44 is it read as 3 separate digits or a single number with 3 digits 15:37:46 ? 15:37:56 that doesn't really matter :) 15:38:33 well, sure, but if it is only one single number you have to do some more work :) 15:38:55 bah . never mind me. being stupid today 15:39:01 :) 15:39:53 ah sorry, I'm back 15:40:02 the input is read as 3 characters 15:40:05 ok 15:40:27 then my method should work 15:40:32 what's the "brainfuck-way" to check if a new number is 58? 15:40:46 subtract 58 and check for 0 with [ 15:40:54 not necessarily 15:41:11 ah 15:41:16 that works only if the interpreter is wrapping 15:41:28 huh? 15:41:59 well, let's say i input '4' in my interpreter -- if i subtract 58 from it it causes underflow 15:42:11 well, then your interpreter is broken IMHO :) 15:42:20 :p 15:42:43 no it's not! 15:43:16 are the bytes signed or unsigned? 15:43:22 signed 15:43:27 i mean unsigned 15:43:28 damn 15:43:29 :p 15:43:32 heh 15:43:35 I'm very new to bf 15:43:45 ah 15:43:52 how did you find out this marvellous language? 15:44:10 again, that depends on the interpreter, but the original used signed WRAPPING bytes.. ;) 15:44:22 damn. unsigned I mean ;D 15:44:23 but the original interpreter is buggy if you remember ;) 15:44:28 well I'm doing some programming challenges and one of them asks me to write such a program in bf 15:44:40 ah 15:44:44 where is that challenge ;) 15:44:59 spoj.sphere.pl 15:45:06 problem18 15:45:09 ok 15:46:43 so to check if a byte is 58, I need to copy the byte first? 15:46:49 yes 15:46:53 yeah 15:46:55 I see 15:47:18 in your case it'd be easiest (not necessarily shortest) to first subtract 48 from the cell when reading input 15:47:35 I see 15:47:37 hmm 15:47:38 then you could check if the cell's value is ten, a bit easier 15:47:53 and when printing out adding 48 to each digit 15:48:11 this way is not the shortest, but it's simplest 15:48:37 okay 15:49:23 are all the bytes guaranteed to be zero at start? 15:49:27 yeah 15:49:31 great 15:50:51 btw, remember the special case that if you increase 999 it'll be no longer three-digit number ;) 15:50:57 yeah 15:51:02 I was thinking this: 15:51:10 use 5 bytes as a start 15:51:17 [0,0,0,0,0] 15:51:21 read in number 15:51:23 like this 15:51:30 [0,0,9,9,9] 15:51:48 do the increase thing, and '<' until you reach a zero byte 15:52:00 [x,1,0,0,0] 15:52:01 argh damn 15:52:13 I thought wrong 15:52:41 you thought correct, but you need to loop there 15:52:57 so i suggest using memory 0 0 1 9 1 9 1 9 15:53:08 where the 1s are booleans 15:53:40 I see, hmm 15:53:42 and you can move slide in the memory by using [>>] kinda structures 15:53:53 it gets a bit more complicated, but not much 15:54:12 the brainfuck way of thinking takes a bit time ;) 15:54:20 yeah I guess :S 15:54:55 there's however a simpler way too 15:55:10 how? 15:55:20 wait.. 15:55:23 (i'm writing) 15:59:40 ok 16:01:26 hmm, i think the loop way is the simplest afterall.. i started making another way but it gets a lot more complicated 16:01:52 I see 16:01:58 i suggest having there something booleans to indicate the current digit that is currently being selected 16:02:15 to allow easier moving, 0 indicating selected and 1 non-selected 16:02:15 yeah it seems like a good ieda 16:03:14 and every take two copies of the digit, then return it, and then check from the other copy if it's 10 -- if it is then set the digit to zero and increase the one on its left side 16:03:43 this is basically the "move left until reach zero byte" 16:04:13 ah great.. I'm gonna eat dinner, I'll be back in a while 16:04:17 o-k 16:12:35 -!- GregorR has joined. 16:13:03 -!- GregorR has quit (Remote closed the connection). 16:13:33 -!- GregorR has joined. 16:29:22 -!- GregorR has quit (Remote closed the connection). 16:29:28 -!- GregorR has joined. 16:31:30 Can you move left if you're in the original position in bf? 16:32:05 you mean from the cell 0? 16:32:06 nope 16:32:18 yes, okay 16:34:52 the flag bytes, are they only used for knowing if the result is 3 or 4 digits? 16:36:14 that as well, but they help you to move around in the array when you're looping 16:36:23 and doing the calculation for every digit 16:36:56 I'm having a bit trouble trying to make this into a fancy loop instead of hardcoding each calculation 16:37:26 heh, yeah -- naturally you can also hardcode each calculation if you want to 16:38:12 I think I give that a try first 16:38:19 ok 16:45:33 hmm 16:46:44 I can't do this heh 16:47:12 well, it can be pretty difficult for a beginner, yes. i didn't learn bf in one night 16:48:03 i can make a sample code if you want to see what it would look like or something 16:48:38 if you look here 16:48:39 http://pastebin.zerovolt.com/101/ 16:49:20 those brackets, [ ], I enter that loop if I have a 9 as most-right digit 16:49:33 right? 16:49:41 wait. 16:51:19 -!- GregorR has quit (Remote closed the connection). 16:51:35 here comes to interpreter question.. if the interpreter is wrapping the only case you DON'T enter the loop is if the value is 10 16:51:37 -!- GregorR__ has joined. 16:52:07 yes 16:52:30 how to construct "if-statements" otherwise? 16:52:39 -[-[-[-[-[-[ 16:52:54 and such 16:53:00 hmm ok 16:53:30 but I would rather like to step inside that bracket body if I got 10 16:53:49 yes 16:53:53 you can do it this way: 16:54:12 -!- GregorR___ has joined. 16:54:20 -!- GregorR__ has quit (Remote closed the connection). 16:54:56 if the smallest value in the cell can be zero; [-[-[-[-[-[-[-[-[-[- now code what happens if cell is 10 ] ] ] ] ] ] ] ] ] ] 16:55:01 hope i didn't lost on count 16:55:22 remember to do that in a copy of the cell, otherwise you'll lose the cell's value 16:55:39 I see 16:56:37 shouldn't it be -[-[-[-[-[-[-[-[-[-[ 16:56:39 ? 16:56:49 it depends what the smallest value there can be 16:57:01 in that example of mine the smallest possible value was zero 16:57:04 ah sorry 16:57:11 your example was correct, I was thinking wrong 16:57:25 ok 17:04:50 http://pastebin.zerovolt.com/102/ 17:04:59 shouldn't that work for 2 numbers? I must've made a mistake somewhere 17:07:02 hmm, it should 17:07:10 i'll run it in interpreter.. 17:07:39 I'm currently trying it on http://koti.mbnet.fi/villes/php/bf.php 17:08:52 ah, you know what the problem is? you forgot to do increase the number 17:09:07 if you input 499 it stays as 499 17:09:24 I don't understand, I'm getting crap output 17:09:35 oh 17:09:37 perhaps that interpreter doesn't work right.. 17:09:52 can you recommend one? 17:09:57 win32 17:11:46 hmm 17:12:26 you could try this: http://www.iamcal.com/misc/bf_debug/ 17:12:30 a one I just downloaded crashed 17:12:33 it's in javascript 17:12:50 ah ok 17:13:03 anyways, you don't increase the last digit in any point 17:13:21 yeah, I should do that in the beginning, before copying 17:13:24 so instead of subtracting 48 subtract 47 17:13:27 yes 17:13:38 or simply sub by 47 17:13:44 as i said :p 17:13:52 ah :P 17:13:59 you were faster 17:14:25 yeah it seems to work 17:15:00 it should work now. when you input 499 it outputs 4:0 which means the middle digit is 10 17:15:03 as it should be 17:16:18 yeah 17:18:33 I should be able to do this on my own now, thanks a lot for your help 17:19:12 you're welcome 17:19:14 good luck 17:21:15 thanks 17:21:22 -!- jix has joined. 17:43:31 -!- calamari has joined. 17:45:14 -!- GregorR____ has joined. 17:45:17 -!- GregorR___ has quit (Remote closed the connection). 18:39:27 bye 18:39:29 -!- Keymaker has left (?). 18:51:23 -!- GregorR_____ has joined. 18:51:42 -!- GregorR____ has quit (Remote closed the connection). 19:09:26 -!- GregorR_____ has quit (Remote closed the connection). 19:10:06 -!- GregorR_____ has joined. 19:28:53 -!- GregorR______ has joined. 19:32:49 -!- GregorR_____ has quit (Remote closed the connection). 20:50:21 -!- Sgeo has joined. 21:28:19 -!- GregorR-L has joined. 21:29:03 -!- jix has left (?). 21:34:22 -!- GregorR_______ has joined. 21:34:24 -!- GregorR______ has quit (Remote closed the connection). 21:42:21 -!- GregorR_______ has quit (Read error: 104 (Connection reset by peer)). 21:43:37 -!- GregorR_______ has joined. 21:54:16 * pgimeno wonders how many _'s will FreeNode support 21:55:17 20:55:32 [freenode] ... IRCD=dancer CAPAB CHANTYPES=# EXCEPTS INVEX CHANMODES=bdeIq,k,lfJD,cgijLmnPQrRstz CHANLIMIT=#:20 PREFIX=(ov)@+ MAXLIST=bdeI:50 MODES=4 STATUSMSG=@ KNOCK NICKLEN=16 are supported by this server 21:55:38 Only two more, then. 21:56:19 (Assuming all freenode servers agree on that NICKLEN, which sounds like a safe assumption.) 21:56:19 maybe GregorR_______ should use some RLE scheme for his nick to support more underscores 21:56:40 -!- pgimeno has changed nick to pgimeno_{32}. 21:56:49 hey, it works! 21:57:48 * pgimeno_{32} doesn't change his nick to pgimeno_{837} to avoid buffer overflows in clients 21:58:05 -!- pgimeno_{32} has changed nick to pgimeno. 22:01:58 -!- GregorR_______ has quit (Remote closed the connection). 22:02:35 -!- GregorR_______ has joined. 22:06:26 -!- GregorR-L has quit (Read error: 113 (No route to host)). 22:18:49 -!- GregorR________ has joined. 22:18:50 -!- GregorR_______ has quit (Remote closed the connection). 23:17:39 -!- Sgeo has quit. 23:24:57 -!- GregorR_________ has joined. 23:26:28 -!- GregorR________ has quit (Read error: 104 (Connection reset by peer)). 23:45:52 -!- GregorR_________ has quit (Remote closed the connection). 23:46:01 -!- GregorR_________ has joined.