Bubba, on 25 March 2013 - 09:50 PM, said:
EDIT: I updated the topic in light of this.
Posted 27 March 2013 - 07:07 AM
Bubba, on 25 March 2013 - 09:50 PM, said:
Posted 27 March 2013 - 01:11 PM
remiX, on 27 March 2013 - 12:39 AM, said:
Bubba, on 25 March 2013 - 09:50 PM, said:
for item=1,15 do local condition = item<=10 and "Less than or equal to 10" or item==11 and "Equal to 11" or "Greater than 11" print(condition) end
<?php for ($i=1; $i <= 15; $i++) { echo $i.' - '.($i < 11 ? 'Less than or equal to 10' : ($i == 11 ? 'Equal to 11' : 'Greater than 11')).'<br>'; } ?>
public class z{ public static void main(String[] args){ for( int i; i <= 15; i++){ System.out.println( i == 11? 'blabla' : 'other blabla' ) } } }
Posted 27 March 2013 - 01:13 PM
Posted 27 March 2013 - 01:16 PM
Kingdaro, on 27 March 2013 - 01:13 PM, said:
Posted 27 March 2013 - 01:26 PM
Posted 27 March 2013 - 05:32 PM
local event, receiveChannel, replyChannel, message, distance = os.pullEvent('modem_message')
local _, _, _, _, distance = os.pullEvent('modem_message')
local event = { os.pullEvent('modem_message') } local distance = event[5]
local distance = ( { os.pullEvent('modem_message') } )[5]
-- this is how you would normally do it local currentX, currentY = term.getCursorPos() term.setCursorPos(1, currentY) -- this is how you could do it with the method described above. term.setCursorPos(1, ({term.getCursorPos()})[2])
term.setCursorPos( term.getCursorPos(), 4 )
Posted 27 March 2013 - 05:37 PM
Kingdaro, on 27 March 2013 - 01:26 PM, said:
Posted 27 March 2013 - 05:43 PM
someVar
"bleh" 42 doStuff()
Posted 27 March 2013 - 08:23 PM
Posted 27 March 2013 - 08:30 PM
Posted 27 March 2013 - 08:37 PM
PonyKuu, on 27 March 2013 - 08:23 PM, said:
PonyKuu, on 27 March 2013 - 08:30 PM, said:
Posted 27 March 2013 - 08:40 PM
Posted 27 March 2013 - 09:27 PM
if term.isColor and term.isColor() then -- this is a computer from cc1.4+ and is an advanced computer and you can change to any colour you wish. elseif term.isColor then -- this is a computer from cc1.4+ and is a non-advanced computer or TURTLE and you can change between black and white else -- this is a computer before cc1.4 and it means that colours are not supported end
Posted 28 March 2013 - 10:27 AM
Posted 28 March 2013 - 10:38 AM
Kingdaro, on 28 March 2013 - 10:27 AM, said:
local evt = {os.pullEvent()} if evt[1] == 'your desired event' then -- make the ifs for that event here elseif evt[2] == 'another event' then -- etc.
Posted 28 March 2013 - 10:46 AM
Posted 02 April 2013 - 05:36 AM
error('Some Error', 0)it will not print the error message with the file name and line number. It is essentially
printError( 'Some Error' ) error()
_G.assert = function(condition, errMsg, level) level = tonumber(level) or 1 if not condition then error(errMsg, (level == 0 and 0 or level + 1)) end return condition end
Posted 02 April 2013 - 09:36 AM
local var = read() print(var)yep, that is my favorite trick, got a problem?
0 members, 1 guests, 0 anonymous users