
-----------------------------------
hackman
Tue Oct 21, 2003 10:48 am

Help with text
-----------------------------------
Can i make text with a line going straight through it, to make the text look like its been crosed out? If so, whats the code? I have to make a Yahtzee game for comp sci and thought this would add a nice affect.

-----------------------------------
Dan
Tue Oct 21, 2003 12:27 pm


-----------------------------------
well there is no text coamnd for that, but you could use the graifcks comands like Draw.Line to draw a line thougth it after you print it on the screen

-----------------------------------
Tony
Tue Oct 21, 2003 3:26 pm


-----------------------------------
if you're using Font.Draw, you can draw another string of

put repeat("-", length(word))


using same coordinates. It should cross it out.

-----------------------------------
hackman
Mon Oct 27, 2003 11:03 am


-----------------------------------
Sorey i took so long to reply. Looks like im gona have to just use drawline.
Tony's idea dosent seem to work on my schools version of turing. Thanks for the replies.

-----------------------------------
Tony
Mon Oct 27, 2003 6:10 pm


-----------------------------------
repeat is a function and returns a value, not a procedure. You'd have to ether assign value to a variable first or use something like put that assepts a value. I modified the code above.

-----------------------------------
hackman
Tue Oct 28, 2003 11:52 am


-----------------------------------
I still get an 'Expression cannot contain subscripts' error.

-----------------------------------
thoughtful
Tue Oct 28, 2003 5:30 pm

example
-----------------------------------
Here is an example of wht tony means  :arrow: 

var font : int := Font.New ("verdana:12")
var word : string
var strikeout : string
var x, y := 50
put "Type in the word to be striked out"
get word : *
cls
Font.Draw (word, x, y, font, black)
strikeout := repeat ("-", length (word) + length (word) div 3)
Font.Draw (strikeout, x, y, font, black)


-----------------------------------
thoughtful
Tue Oct 28, 2003 5:36 pm

Mine
-----------------------------------
I made this program which can strikeout almost ne fontsize and look pretty good


const fontsize:=40
var font : int := Font.New ("verdana:"+intstr(fontsize))
var word : string
var strikeout : string
var x, y := 50
put "Type in the word to be striked out"
get word : *
cls
Font.Draw (word, x, y, font, black)
strikeout := repeat ("_", length (word)-length(word) div 10)
Font.Draw (strikeout, x, y+(fontsize div 2), font, black)

Change the fountsize:= value to change the font size

-----------------------------------
hackman
Wed Oct 29, 2003 10:54 am


-----------------------------------
Ok, now i get it. Thanks.
