
viewtopic.php?t=18133&start=15
the challenge is:
- create some routine that turns 'multiline' purebasic code into single line
- purebasic code, using purebasic only (no asm)
- each line is considered part of a multiline if it ends on [space][underscore], OR
- each line may have a comment after a [space][underscore][space] sequence
- after processing the total number of lines should be the same
- your code may strip the comments
- your code does not need to handle colon's (but it may)
- your code must accept single and double parenthesis ' and "
for bonus points you're allowed to make the 'comments allowed rule' (number 4 above) optional, ie. add a flag to do so or not
who writes the nicest / fastest routine?
and the price? euh... my gratefullness? your name mentioned in codecaddy? or just a general feeling of being good?

example:
Code: Select all
Debug 2+2+ _ ; this is the first line
2 ; and this is the second
Code: Select all
Debug 2+2+2
Code: Select all
OpenWindow( #1,10,10, 100,100, _ ; line 1
#PB_Window_SystemMenu, _ ; line 2
"test") ; line 3 contains the title 'test'
Code: Select all
OpenWindow( #1,10,10,100,100, #PB_Window_SystemMenu, "test")
here's a file to process (just copy it and save it, then use your code to process it)
Code: Select all
Debug '_' + _
'_' ; this is not as easy
Debug '"' + _ ; as it looks
'a'
Debug "'" + "a" + "'" ; ah, the joys of coding
Debug Chr('_') _
; can make life so sweet
Debug "_ is the same as " _
+ Chr('_')
a.l = 1 + _ ; multiline ahoy
2 + _
'b' + _
Asc("c")
;
w_main_nr = OpenWindow(#PB_Any, _
10,10, _
100,100, _
#PB_Window_SystemMenu, _
"Test")
Repeat
event = WaitWindowEvent()
Until event = #PB_Event_CloseWindow
End