This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Twitter for Android | |
Consumer key: 3nVuSoBZnx6U4vzUxf5w | |
Consumer secret: Bcs59EFbbsdF6Sl9Ng71smgStWEGwXXKSjYvPVt7qys | |
Twitter for iPhone | |
Consumer key: IQKbtAYlXLripLGPWd0HUA | |
Consumer secret: GgDYlkSvaPxGxC4X8liwpUoqKwwr3lCADbz8A7ADU | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a, b = 10, 25 | |
function sum(a, b) | |
return a + b | |
end | |
print(sum(a, b)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
print "あなたの身長は?" | |
cm = io.read("*n") | |
function convert(cm) | |
t = { | |
"inch\t" .. cm / 2.54, | |
"feet\t" .. cm / 30.48, | |
"yard\t" .. cm / 91.44, | |
"digit\t" .. cm / 1.905, | |
"mile\t" .. cm / 160934.4, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function swap(x, y) do | |
return y, x | |
end | |
print(swap(1, 2)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for i = 1, 9 do | |
for j = 1, 9 do | |
print(i .. " * " .. j .. " = " .. i * j) | |
end | |
print("\n") | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
print(string.format("あなたの月勤務数は %d 日間ですね。", calc1) ) | |
calc2 = (x * y) * z * 4 | |
print(string.format("あなたの1ヶ月間の給料は %d 円です。", calc2)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- アルバイト時給換算 | |
a={nil,nil,nil,nil,nil,nil} | |
print("貴方の時給") -- X | |
a[1]=io.read("*n") | |
print("貴方が一日働く時間は?") -- Y | |
a[2]=io.read("*n") | |
print("貴方の週勤務数は?") -- Z | |
a[3]=io.read("*n") | |
a[4]=a[3]*4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- アルバイトの給料計算。 | |
print("あなたの時給は?") | |
x = io.read() | |
print(x) | |
print("あなたは何時間勤務?") | |
y = io.read() | |
print(y) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
x = io.read() | |
print(x) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for i = 1, 100 do | |
if i % 3 == 0 and i % 5 == 0 then | |
print("FizzBuzz") | |
elseif i % 3 == 0 then | |
print("Fizz") | |
elseif i % 5 == 0 then | |
print("Buzz") | |
else print(i) | |
end | |
end |