Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Picture Background
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Seguin




PostPosted: Mon Apr 23, 2007 12:41 pm   Post subject: Picture Background

HEY!

ok so i have this assignemnt to do and this si what I have to do:
Write a program which quizzes the user on the capitals of the provinces of Canada. Give the user three chances at each. Inform the user if they guessed correctly or incorrectly.
I also am putting a map of Canada as the background the only problem is that when i type my answers it covers the map. How can i make teh writing over the map without it erasing?

Thanxs Very Happy

CODE:

var backgroundPic: int
backgroundPic := Pic.FileNew ("Map.jpg")
Pic.Draw (backgroundPic,100,-0,picCopy)

% British Colombia
var answer: string
put "What is the Capital of British Colombia:"..
get answer
if answer = "Victoria" or answer = "victoria" then
put "WOOT -happy dance-"
else
put "YOU ARE SO...NOT RIGHT!"
end if

% Alberta\
put "What is the Capital of Alberta:"..
get answer
if answer= "Edmonton" or answer = "edmonton" then
put "RIGHTO!"
else
put "hahaha NO!"
end if

% Saskatchewan
put "What is the Capital of Saskatchewan:"..
get answer
if answer= "Regina" or answer = "regina" then
put "OH YA!"
else
put "NADA!"
end if

% Manitoba
put "What is the Capital of Manitoba:"..
get answer
if answer= "Winnipeg" or answer = "winnipeg" then
put "YAY!"
else
put "NOPE!"
end if

% Ontario
put "What is the Capital of Ontario:"..
get answer
if answer= "Toronto" or answer = "toronto" then
put "OF COURSE, YOU BETTER KNOW!"
else
put "HOW MUCH MORE CLUELESS CAN YOU BE! YOU LIVE IN THE PROVINCE!"
end if

% Quebec
put "What is the Capital of Quebec:"..
get answer
if answer= "Quebec" or answer = "quebec" then
put "SMART ONE!"
else
put "THERE JUST QUEBECQUERS, WHO NEEDS TO KNOW!"
end if

% New Brunswick
put "What is the Capital of New Brunswick:"..
get answer
if answer= "Fredericton" or answer = "fredericton" then
put "SCORE!"
else
put "Miss!"
end if


% Nova Scotia
put "What is the Capital of Noca Scotia:"..
get answer
if answer= "Halifax" or answer = "halifax" then
put "HIT!"
else
put "SINK!"
end if

% Prince Edward Island
put "What is the Capital of Prince Edward Island:"..
get answer
if answer= "Charlottetown" or answer = "charlottetown" then
put "YUPPERS!"
else
put "BLAH NO!"
end if

% Newfoundland and Labrador
put "What is the Capital of Newfoundland and Labrador:"..
get answer
if answer= "St. John's" or answer = "st. John's" then
put "THUMBS UP!"
else
put "THUMBS DOWN!"
end if

% Northwest Territories
put "What is the Capital of Northwest Territories:"..
get answer
if answer= "Yellowknife" or answer = "yellowknife" then
put "GOOD!"
else
put "BAD!"
end if

% Nunavut
put "What is the Capital of Nunavut:"..
get answer
if answer= "Iqualuit" or answer = "iqualuit" then
put "Negative!"
else
put "Positive!"
end if

% Yukon
put "What is the Capital of Yukon:"..
get answer
if answer= "Whitehorse" or answer = "whitehorse" then
put "Yes!"
else
put "No!"
end if
Sponsor
Sponsor
Sponsor
sponsor
PaulButler




PostPosted: Mon Apr 23, 2007 1:14 pm   Post subject: RE:Picture Background

You got negative and positive mixed up on Nunavut.
klopyrev




PostPosted: Mon Apr 23, 2007 2:33 pm   Post subject: Re: Picture Background

"What is the Capital of Yukon:" Wow... easy question! It's WhiteHorse, of course!!! No??? aaah... (spends hours researching...) It is WhiteHorse... wtf??? oh... yeah... it's Whitehorse (Small 'h')

KL
Seguin




PostPosted: Tue Apr 24, 2007 11:27 am   Post subject: Re: Picture Background

ok thanxs for pointing out my stupid mistakes! Embarassed but can anyone help me with my other problem which is how to make the map stay in the background?

CODE:
var backgroundPic: int
backgroundPic := Pic.FileNew ("Map.jpg")
Pic.Draw (backgroundPic,100,-0,picCopy)

% British Colombia
var answer: string
put "What is the Capital of British Colombia:"..
get answer
if answer = "Victoria" or answer = "victoria" then
put "WOOT -happy dance-"
else
put "YOU ARE SO...NOT RIGHT!"
end if

% Alberta\
put "What is the Capital of Alberta:"..
get answer
if answer= "Edmonton" or answer = "edmonton" then
put "RIGHTO!"
else
put "hahaha NO!"
end if

% Saskatchewan
put "What is the Capital of Saskatchewan:"..
get answer
if answer= "Regina" or answer = "regina" then
put "OH YA!"
else
put "NADA!"
end if

% Manitoba
put "What is the Capital of Manitoba:"..
get answer
if answer= "Winnipeg" or answer = "winnipeg" then
put "YAY!"
else
put "NOPE!"
end if

% Ontario
put "What is the Capital of Ontario:"..
get answer
if answer= "Toronto" or answer = "toronto" then
put "OF COURSE, YOU BETTER KNOW!"
else
put "HOW MUCH MORE CLUELESS CAN YOU BE! YOU LIVE IN THE PROVINCE!"
end if

% Quebec
put "What is the Capital of Quebec:"..
get answer
if answer= "Quebec" or answer = "quebec" then
put "SMART ONE!"
else
put "THERE JUST QUEBECQUERS, WHO NEEDS TO KNOW!"
end if

% New Brunswick
put "What is the Capital of New Brunswick:"..
get answer
if answer= "Fredericton" or answer = "fredericton" then
put "SCORE!"
else
put "Miss!"
end if


% Nova Scotia
put "What is the Capital of Noca Scotia:"..
get answer
if answer= "Halifax" or answer = "halifax" then
put "HIT!"
else
put "SINK!"
end if

% Prince Edward Island
put "What is the Capital of Prince Edward Island:"..
get answer
if answer= "Charlottetown" or answer = "charlottetown" then
put "YUPPERS!"
else
put "BLAH NO!"
end if

% Newfoundland and Labrador
put "What is the Capital of Newfoundland and Labrador:"..
get answer
if answer= "St. John's" or answer = "st. John's" then
put "THUMBS UP!"
else
put "THUMBS DOWN!"
end if

% Northwest Territories
put "What is the Capital of Northwest Territories:"..
get answer
if answer= "Yellowknife" or answer = "yellowknife" then
put "GOOD!"
else
put "BAD!"
end if

% Nunavut
put "What is the Capital of Nunavut:"..
get answer
if answer= "Iqualuit" or answer = "iqualuit" then
put "Positive!"
else
put "Negative!"
end if

% Yukon
put "What is the Capital of Yukon:"..
get answer
if answer= "Whitehorse" or answer = "whitehorse" or answer= "WhiteHorse" then
put "Yes!"
else
put "No!"
end if
rollerdude




PostPosted: Tue Apr 24, 2007 12:02 pm   Post subject: Re: Picture Background

it may take a bit more time but how about something like

code:

var font1 : int := Font.New ("serif:12")
assert font1>0
Font.Draw("Hi",5,5,font1,black)


but instead of the text simply put on the screen by the user, you'de have to use this for each letter that the person type (like throw the char in an array and then type it)

it will take time, and i'm sure there's probably a better way, but i hope this helps


Note to clayton: i used the code thingys so you dont have to mod
Seguin




PostPosted: Tue Apr 24, 2007 12:12 pm   Post subject: RE:Picture Background

Alright thanxs i'll try it!

=D
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 6 Posts ]
Jump to:   


Style:  
Search: