Home
Project Folders
Teacher Resources
Student Resources
How Do I?
Literacy
MWForum
Site Map
Search
Our Team

MWForum Message [Date Index] [Threads] [Authors] [Attachments] [Subscribe]

[Thread Prev] [Thread Next]

To: MicroWorlds Forum <mwforum@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>
Subject: Re: Writting and programming hangman(agian)
From: Anthony Trader <anthonytrdr@xxxxxxxxx>
Date: Thu, 9 Jun 2011 12:09:01 -0700 (PDT)

__________________________________________________________
Dear Daniel,
 
I'd like to see if you'd be willing to proof-read my code. Would you mind
checking to see if theres anything missing or if its all messed up. i desire
your input and will attach a notepad copy of my code with a screenshot as well.
Thank you very much for all of your guy's help.
sincerely,
-Anthony
___________________________________________________________

--- On Wed, 6/8/11, Daniel Ajoy <da.ajoy@xxxxxxxxx> wrote:


From: Daniel Ajoy <da.ajoy@xxxxxxxxx>
Subject: Writting and programming
To: "LogoForum@xxxxxxxxxxxxxxx" <LogoForum@xxxxxxxxxxxxxxx>, "MWForum" <mwforum@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>
Date: Wednesday, June 8, 2011, 4:09 PM


http://ask.slashdot.org/comments.pl?sid=2198700&cid=36293622

;TO DO:
;Make it so that if the letter is clicked on it checks to see if it is the correct letter. list the misses on in a box on
;the bottom

================
To _1
getpage "page1
end

To _2
getpage "page2
end

To _3
getpage "page3
end
============================================
;		        start_page			;
============================================
To |start game|
local "text1
make "text1 [Would you like to play hangman?|
|Type yes or no]
question :text1
If (answer = "yes) [Announce [Let the trials begin] _1 word_list]
If (answer = "no) [Announce [Goodbye] wait 3 getpage "startpage]
If (answer = "|| ) [insist]
end

to insist
|start game|
end

============================================
;		        Game_page			;
============================================

to Click
make "letter [listen [A B t3 D E F G t8 I J K L M N O P Q R S T U V W t24 t25 Z]]
prove
;ht
end
_____________
;forever counter with trouble shooting using "if"
;the counter is to keep track of incorrect guesses

to countercount
talkto "t1
setx 340
sety -186
local "counter
make "counter 0
forever [talkto "t1
fd 1 wait 1 rt 90
fd 1 wait 1
show :counter
make "counter sum :counter 1
if (:counter = 0) []				;[check letter] if wrong add 1
if (:counter = 1) [talkto "bodypart1 setpos [162 122]]
if (:counter = 2) [talkto "bodypart2 setpos [163 96]]
if (:counter = 3) [talkto "bodypart3 setpos [144 92]]
if (:counter = 4) [talkto "bodypart4 setpos [183 92]]
if (:counter = 5) [talkto "bodypart6 setpos [158 57]]
if (:counter = 6) [talkto "bodypart5 setpos [171 57] wait 5 lose]
when [:counter = 6][stopall]]
end
_____________
;restart sets all the turtles in the proper spots

to restart
everyone [st]
A, setpos [-363 -136]
B, setpos [-343 -136]
t3, setpos [-323 -136]
D, setpos [-303 -136]
E, setpos [-283 -136]
F, setpos [-263 -136]
G, setpos [-243 -136]
t8, setpos [-223 -136]
I, setpos [-203 -136]
J, setpos [-183 -136]
K, setpos [-163 -136]
L, setpos [-143 -136]
M, setpos [-123 -136]
N, setpos [-103 -136]
O, setpos [-83 -136]
P, setpos [-63 -136]
Q, setpos [-43 -136]
R, setpos [-23 -136]
S, setpos [-3 -136]
T, setpos [17 -136]
U, setpos [37 -136]
V, setpos [57 -136]
W, setpos [77 -136]
t24, setpos [97 -136]
t25, setpos [117 -136]
Z, setpos [137 -136]
;talkto "t34
;text1, print :Misses
;Cleartext
wait 5 getpage "startpage
end
=======================
_______________________

;this section is dedicated to the programs MWforums sent

To word_list
make "word pick [absurd adverb viewer amulet arisen author binder bishop blond busted
candle cipher climax closed cringe dainty deploy deputy diaper dragon employ enlist famine
family frolic fridge frozen hyrule garlic gifted harlot honest hybrid impact infect island
jumper keypad kindle knight lanced lawyer legacy locket loving market matrix minute molten
morsel nebula nickel nimble palmer pantry phobic plague plunge pocket poster presto ransom]
ask [text1 text2 text3 text4 text5 text6] [ct]
show sentence [the word is] :word
talkto "t1
setinstruction [make "a]
end

to prove ;:letter
make "letter [listen [A B t3 D E F G t8 I J K L M N O P Q R S T U V W t24 t25 Z]]
setpos 1			;setpos does not like input in prove? etpos needs one input: a list of two numbers.
repeat count :word [
if :letter = item position :word [
  talkto word "text position
  print :letter "text
]
setpos position + 1
]
end

============
;to placethisatthatpositioninthatlist :thingtoplace :position :targetlist
;if :position = 1 [op fput :thingtoplace :targetlist]
;op fput first :targetlist placethisatthatpositioninthatlist :thingtoplace
;:position - 1  bf :targetlist
;end
=============
__________________________
==========================

;The Wining and losing progs

to Lose
announce [Game over|
|Feel free to play again]
restart
end

to Win
announce [You've won and have saved the man|
|to play again press: again]
end

to again
word_list
end
__________
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

Attachment: hangmanscreenshot.bmp
Description: Windows bitmap


  • Previous by thread: Writting and programming
  • Next by thread: Logo-Math lessons

  • To save an attachment to your computer, PC users should right-click (Mac users, click and hold the mouse button) on the link and then choose 'save target as' from the pop-up menu. A window will then pop up in which you can choose a location for the file.


    © copyright 2001 - 2008