Sefel

Blitz3D Forums/Blitz3D Beginners Area/Sefel

Agamer(Posted 2003) [#1]
This is my text project were it will talk to you

Here is the source code so far

Repeat 

Graphics 1024,768 

		Print"Hi! what is your name?" 
		name$=Input() 
	Print"" 
	Print"Hi " +name$+ ", my name is blie." 
	Print"" 
		Print"How old are you?" 
		Age$=Input() 
	Print"" 
	Print"So you're " +Age+ " years old, right " +name+ "?" 
	Print"" 
		Delay 1500 
	Print"I am 45894869848708580009098787877565645454546756565757 but give or take " +Age+ " years" 
	Print"" 
		Print"Do you like me?" 
		Like$=Input() 
		Print"" 

If Lower$(Like)="yes" 
		Print"I like you too, " +name$+ "." 
Else 
		If Lower$(Like)="maybe" 
				Print"You're ok." 
				Print"" 
		Else 
				Print"Why don't you like me?" 
				Why$=Input() 
				Print"So you don't like me " +Why$+ "." 
		EndIf 
EndIf  


Print"Are you a Male or Female?" 
Sex$=Input() 
;Male 
	If Lower$(Sex)="male" 
			Print"Are you married?" 
			MMarried$=Input() 
			If Lower$(MMarried)="yes" 
					Print"What is your wife's name?" 
					Wname$=Input() 
					Print"Say hi to your wife " +Wname$+ "." 
		
			ElseIf 	Lower$(MMarried)="no" And age$=>"18" Then
					Print"There are plenty of fish in the sea." 
	
	
			Else Print"Well you're still a bit young"
			
			
	
	EndIf
	 
Else 
;Female 
		Print"Are you married?" 
		FMarried$=Input() 
		If Lower$(FMarried)="yes" 
				Print"What is your husband's name?" 
				Hname$=Input() 
				Print"Say hi to your husband " +Hname$+ "." 
		
		ElseIf  Lower$(FMaried)="no" And age$=>"18" Then	
				Print"i hope you find someone." 
		
				Else Print"You're still a bit young"
		
		Print"" 
	
	
	EndIf 

EndIf 

	Print"Play again"
		again$=Input("Yes or No: ") 
If Lower$(again$)="no" Then End
Forever 


I'm only new had blitz for less than a day so it's not that goood but I will keep improving this in odd times

Any feedback would be cool and if you see something i did wrong please tell. Any one who tests it and fins any probles please tell as i may of missed them.

Thankyou In advance for any help or advice


BlitzSupport(Posted 2003) [#2]
Couple of points:

Put the 'Repeat' AFTER the 'Graphics' call (you're setting the display mode each time someone plays again).

Also, if your answers are hard-coded (ie. only certain words -- yes, no, maybe -- you should really suggest the acceptable answers your program will take, eg. a$ = Input ("What is your answer (yes or no): ").

Still, you've got the basics there :)


Tricky(Posted 2003) [#3]
If Lower$(again$)="no" Then End
Forever 


I would have used
Until Lower$(again$)="no"
End


Not so much better, but it's handier to stick this way, as it can help when coding more complex games...


Agamer(Posted 2003) [#4]
Ok and to blitz soupurt i would do that that but that clears the screnn after use


pjd(Posted 2003) [#5]
are you saying you WANT it to clear the screen after use ?

If so, why not use the "cls" command ?


Agamer(Posted 2003) [#6]
wel i can't see were i would put itand this does the same job


Agamer(Posted 2003) [#7]
I did this

Graphics 1024,768 

Repeat 

		Cls
		Print"Hi! what is your name?" 
		name$=Input() 
	Print"" 
	Print"Hi " +name$+ ", my name is blie." 
	Print"" 
		Print"How old are you?" 
		Age$=Input() 
	Print"" 
	Print"So you're " +Age+ " years old, right " +name+ "?" 
	Print"" 
		Delay 1500 
	Print"I am 45894869848708580009098787877565645454546756565757 but give or take " +Age+ " years" 
	Print"" 
		Print"Do you like me?" 
		Like$=Input() 
		Print"" 

If Lower$(Like)="yes" 
		Print"I like you too, " +name$+ "." 
Else 
		If Lower$(Like)="maybe" 
				Print"You're ok." 
				Print"" 
		Else 
				Print"Why don't you like me?" 
				Why$=Input() 
				Print"So you don't like me " +Why$+ "." 
		EndIf 
EndIf  


Print"Are you a Male or Female?" 
Sex$=Input() 
;Male 
	If Lower$(Sex)="male" 
			Print"Are you married?" 
			MMarried$=Input() 
			If Lower$(MMarried)="yes" 
					Print"What is your wife's name?" 
					Wname$=Input() 
					Print"Say hi to your wife " +Wname$+ "." 
		
			ElseIf 	Lower$(MMarried)="no" And age$=>"18" Then
					Print"There are plenty of fish in the sea." 
	
	
			Else Print"Well you're still a bit young"
			
			
	
	EndIf
	 
Else 
;Female 
		Print"Are you married?" 
		FMarried$=Input() 
		If Lower$(FMarried)="yes" 
				Print"What is your husband's name?" 
				Hname$=Input() 
				Print"Say hi to your husband " +Hname$+ "." 
		
		ElseIf  Lower$(FMaried)="no" And age$=>"18" Then	
				Print"I hope you find someone." 
		
				Else Print"You're still a bit young"
		
		Print"" 
	
	
	EndIf 

EndIf 

Cls

	Print"Play again"
		again$=Input("Yes or No: ") 
If Lower$(again$)="no" Then End

Forever 


but now it clears it and mives it down the screnn i want it to apear at the top any way to do this as it takes sometime to reset.
PLease help