Monday, June 25, 2012
Sunday, June 24, 2012
Sunday, 24th June 2012
Woke up at 4.30 pm today, nothing to do x.x
Ate potato chips and cadbury chocolate at late night
Also watched Dantalian no Shoka before sleep
Ate potato chips and cadbury chocolate at late night
Also watched Dantalian no Shoka before sleep
Saturday, 23th June 2012
Watched Finding Nemo with Muffin
Ate sushi before going my house
Then went to eat Mac Donald for dinner x.x
Double Cheese Burger~
Then play mahjong / poker with friends until late night 2 am lol
Ate Mac Donald again
This time is Mc Chicken Meal + some Mc Nuggets
Ate sushi before going my house
Then went to eat Mac Donald for dinner x.x
Double Cheese Burger~
Then play mahjong / poker with friends until late night 2 am lol
Ate Mac Donald again
This time is Mc Chicken Meal + some Mc Nuggets
Friday, June 22, 2012
Last Question in Programming UT 1
total = a+b
if (a > b):
diff = a - b
else:
diff = b - a
if (a == 7 or b == 7):
return True
elif (total == 7 or diff == 7):
return True
else:
return False
Friday, 22th June 2012
Today Communication Practice
Need go down for a talk, by Mr Sam Tan
Discussed about how communication barrier can be formed by 4 type of noises
- Physical
- Psychological
- Physiological
- Semantic
Afterwards, went for programming UT
So hard sia lol
Need go down for a talk, by Mr Sam Tan
Discussed about how communication barrier can be formed by 4 type of noises
- Physical
- Psychological
- Physiological
- Semantic
Afterwards, went for programming UT
So hard sia lol
Guessing Game
Made this game with the help of 6P and prior knowledge from ITE de C# programming
Just a simple guessing game in Python that only requires user to guess a digit from 1 to 99 by just entering the answer they feel is right
The code :
import random
ans = random.randint(1,99)
low = 1
high = 99
temp_low = 0
temp_high = 0
guess = ' '
tries = 1
while (guess != ans):
tries = tries + 1
guess = raw_input("Guess the number between 1 and 99: ")
try:
guess = int(guess)
if guess < 1 or guess > 99:
print "Please enter between 1 to 99"
exit()
except:
print "Invalid Entry, Game Over"
exit()
if guess < ans:
if guess > low:
temp_low = guess
low = guess
if low > temp_low:
low = low
else:
low = temp_low
print "You entered " + `guess`
print "It is HIGHER than " + `low` + " but LOWER than " + `high`
elif guess > ans:
if guess < high:
temp_high = guess
high = guess
if high < temp_high:
high = high
else:
high = temp_high
print "You entered " + `guess`
print "It is HIGHER than " + `low` + " but LOWER than " + `high`
print "Well done!"
print "The answer is "+ `ans` + "!"
print "You took " + `tries` + " tries"
if tries <= 5:
print "Wow, you're really lucky"
if tries > 5 and tries <= 10:
print "Not bad, quite lucky~"
else:
print "Nice effort, you might be luckier on next game!"
Gonna try create Scissor, Paper, Stone game with a similar concept when free
Just a simple guessing game in Python that only requires user to guess a digit from 1 to 99 by just entering the answer they feel is right
The code :
import random
ans = random.randint(1,99)
low = 1
high = 99
temp_low = 0
temp_high = 0
guess = ' '
tries = 1
while (guess != ans):
tries = tries + 1
guess = raw_input("Guess the number between 1 and 99: ")
try:
guess = int(guess)
if guess < 1 or guess > 99:
print "Please enter between 1 to 99"
exit()
except:
print "Invalid Entry, Game Over"
exit()
if guess < ans:
if guess > low:
temp_low = guess
low = guess
if low > temp_low:
low = low
else:
low = temp_low
print "You entered " + `guess`
print "It is HIGHER than " + `low` + " but LOWER than " + `high`
elif guess > ans:
if guess < high:
temp_high = guess
high = guess
if high < temp_high:
high = high
else:
high = temp_high
print "You entered " + `guess`
print "It is HIGHER than " + `low` + " but LOWER than " + `high`
print "Well done!"
print "The answer is "+ `ans` + "!"
print "You took " + `tries` + " tries"
if tries <= 5:
print "Wow, you're really lucky"
if tries > 5 and tries <= 10:
print "Not bad, quite lucky~"
else:
print "Nice effort, you might be luckier on next game!"
Gonna try create Scissor, Paper, Stone game with a similar concept when free
Thursday, June 21, 2012
Worksheet [List]
# Lucky Number
name = raw_input("Enter your full name")
def calculateLuckyNumber(name):
nameSplit = name.split(' ')
F = len(nameSplit[0])
S = len(nameSplit[1])
T = len(nameSplit[2])
luckyNum = ((2 * F + S) + T) % 10
return luckyNum
print calculateLuckyNumber(name)
# Using List
sentence = "Dell profit surges on revived business spend"
words = sentence.split()
print words[0] + " " + words[4] + " " + words[5]
print len(words[0]) + len(words[4]) + len(words[5])
#Filtering Words
sentence = 'cat dog lion tiger mouse cow'
sentenceSplit = sentence.split(' ')
for a in range(0,6,1):
count = len(sentenceSplit[a])
if count == 3:
print sentenceSplit[a]
# Sum Up Numbers
num_list = range(0,30,4)
total = 0
for a in num_list:
total = total + a
print total
# Sum Up Even Numbers
num_list = range(0,30,3)
total = 0
for x in num_list:
if x % 2 == 0:
total+=x
print total
# Count even numbers
num_list = range(0,30,3)
even = 0
for x in num_list:
if x % 2 == 0:
even+=1
print even
name = raw_input("Enter your full name")
def calculateLuckyNumber(name):
nameSplit = name.split(' ')
F = len(nameSplit[0])
S = len(nameSplit[1])
T = len(nameSplit[2])
luckyNum = ((2 * F + S) + T) % 10
return luckyNum
print calculateLuckyNumber(name)
# Using List
sentence = "Dell profit surges on revived business spend"
words = sentence.split()
print words[0] + " " + words[4] + " " + words[5]
print len(words[0]) + len(words[4]) + len(words[5])
#Filtering Words
sentence = 'cat dog lion tiger mouse cow'
sentenceSplit = sentence.split(' ')
for a in range(0,6,1):
count = len(sentenceSplit[a])
if count == 3:
print sentenceSplit[a]
# Sum Up Numbers
num_list = range(0,30,4)
total = 0
for a in num_list:
total = total + a
print total
# Sum Up Even Numbers
num_list = range(0,30,3)
total = 0
for x in num_list:
if x % 2 == 0:
total+=x
print total
# Count even numbers
num_list = range(0,30,3)
even = 0
for x in num_list:
if x % 2 == 0:
even+=1
print even
Thursday, 21th June 2012
Today do programming
I know how to do, but don't know how to explain lol
Need make a program called Fortune Teller / Lucky Lucky
Take in the user's name and day, calculate lucky number & color
I know how to do, but don't know how to explain lol
Need make a program called Fortune Teller / Lucky Lucky
Take in the user's name and day, calculate lucky number & color
Wednesday, June 20, 2012
Wednesday, 20th June 2012
Today Creative Concepts
Need design a float for Chingay festival
Theme is Garden City
I never go to Chingay before, so I don't know what is it lol
Just playing along with it
Need artist for this mission lol
Made a few China quality buildings with paper and others with recycled stuffs.
Both me & Muffin feeling abit sick today
I recovered after drinking cold water & hyper for nothing
But she still sick, hope she recover soon x.x
Need design a float for Chingay festival
Theme is Garden City
I never go to Chingay before, so I don't know what is it lol
Just playing along with it
Need artist for this mission lol
Made a few China quality buildings with paper and others with recycled stuffs.
Both me & Muffin feeling abit sick today
I recovered after drinking cold water & hyper for nothing
But she still sick, hope she recover soon x.x
Subscribe to:
Posts (Atom)