A Challenge
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
A Challenge
I came across Rev v2.8 on the cover disk of a
computer magazine.
It had a restriction. You could only write a
programme with a maximum of ten lines of code.
The Challenge: What's the best you can do with ten lines?
computer magazine.
It had a restriction. You could only write a
programme with a maximum of ten lines of code.
The Challenge: What's the best you can do with ten lines?
Is age an excuse? Eighty-four and counting.
Programming powered by coffee.
Programming powered by coffee.
Re: A Challenge
Write a handler that sends a short email message to Colin Holgate.
Craig Newman
Craig Newman
Re: A Challenge
dunbarx
If only I could. Show me how - in as many lines
as it takes.
If only I could. Show me how - in as many lines
as it takes.
Is age an excuse? Eighty-four and counting.
Programming powered by coffee.
Programming powered by coffee.
Re: A Challenge
Ross.
This was an inside joke. The Mr. Holgate I referred to was always able to write a handler with fewer lines than I could. This started when we ran the New York HC user group.
See this:
http://forums.livecode.com/viewtopic.ph ... es#p102767
Craig
EDIT. I have no idea why I used the msg box in that silly thread (or at least my portion of it, where it turned silly) but I would have used a variable normally:
I cannot see a way to do this in one line...
EDIT again.
I see that there had to be an "output" along the way. This could easily have been another field, I suppose, so the "variable" edit above would not quite do.
This was an inside joke. The Mr. Holgate I referred to was always able to write a handler with fewer lines than I could. This started when we ran the New York HC user group.
See this:
http://forums.livecode.com/viewtopic.ph ... es#p102767
Craig
EDIT. I have no idea why I used the msg box in that silly thread (or at least my portion of it, where it turned silly) but I would have used a variable normally:
Code: Select all
on mouseup
put any line of fld 1 into temp
delete char offset(temp,fld 1) to the length of temp + offset(temp,fld 1) of fld 1
end mouseup
EDIT again.
I see that there had to be an "output" along the way. This could easily have been another field, I suppose, so the "variable" edit above would not quite do.
Last edited by dunbarx on Tue May 17, 2016 6:54 am, edited 2 times in total.
Re: A Challenge
RossG,
The 10 line restriction does not apply to the whole stack... As far as I remember, it was a restriction placed on each object... so, you could have 10 lines of script in a button and 10 lines of script in a field, ten lines of script in the stack script, 10 lines in the card script... So, that being the case, with some careful thought you could accomplish quite a lot !...
The 10 line restriction does not apply to the whole stack... As far as I remember, it was a restriction placed on each object... so, you could have 10 lines of script in a button and 10 lines of script in a field, ten lines of script in the stack script, 10 lines in the card script... So, that being the case, with some careful thought you could accomplish quite a lot !...

Re: A Challenge
Dixie.
Wasn't that limitation for an early trial version of LC? Why else would such a thing be?
Craig
Wasn't that limitation for an early trial version of LC? Why else would such a thing be?
Craig
Re: A Challenge
Dunbarx...
Yes, it was a restriction placed on the use of the software... The actual details of using it escape me, I can't remember if it was a 'trial' package by itself, or if that is how it worked until a serial number was entered...
Yes, it was a restriction placed on the use of the software... The actual details of using it escape me, I can't remember if it was a 'trial' package by itself, or if that is how it worked until a serial number was entered...
-
- Livecode Opensource Backer
- Posts: 366
- Joined: Tue Apr 10, 2012 9:18 am
Re: A Challenge
RossG wrote:I came across Rev v2.8 on the cover disk of a
computer magazine.
It had a restriction. You could only write a
programme with a maximum of ten lines of code.
The Challenge: What's the best you can do with ten lines?
Here is my application with less than 10 lines, one field and one button:
Code: Select all
on mouseUp
put URL "http://api.icndb.com/jokes/random" into tJSON
put JsonImport(tJSON) into tArray
put tArray["value"]["joke"] into field the_joke
end mouseUp
Re: A Challenge
ghettocottage
Thanks for entering into the spirit of the challenge.
Your few lines of code introduced me to great things I
didn't know - the whole purpose of the challenge.
Thanks for entering into the spirit of the challenge.
Your few lines of code introduced me to great things I
didn't know - the whole purpose of the challenge.
Is age an excuse? Eighty-four and counting.
Programming powered by coffee.
Programming powered by coffee.