Simple Program that was made for yesterday

Blitz3D Forums/Blitz3D Beginners Area/Simple Program that was made for yesterday

Yo! Wazzup?(Posted 2007) [#1]
It was really made for Friday the 13th, but... here you go.




Also, remember the example.
You can type 040909 instead of 40909, but it wasn't made like that.


CS_TBL(Posted 2007) [#2]
indenting?
gotos/labels :S


ingenium(Posted 2007) [#3]
Are you asking for help? ^^


Yo! Wazzup?(Posted 2007) [#4]
No…
People get mad when I post this kind of thing in the Blitz Showcase.


big10p(Posted 2007) [#5]
I've gone blind!


Yo! Wazzup?(Posted 2007) [#6]
gotos/labels :S

What is a label :P


ingenium(Posted 2007) [#7]
ehm...
goto alpha
.alpha


.alpha = label :)


Yo! Wazzup?(Posted 2007) [#8]
Uhhh...
Hehe before today I remembered what a label is…
I forgot when I posted :P


Gabriel(Posted 2007) [#9]
For Future reference, Instr returns an integer, not a string.

If you feel like a challenge, now try rewriting the program so that it detects automatically if it's Friday the 13th without me having to enter anything.

Hint #1: You can change your date to test/debug.


Yo! Wazzup?(Posted 2007) [#10]
#1-Right... I should fix that. You mean I shouldn't do quotes?

#2-I can't do that yet. I'm still new at programming and have no idea how.


Gabriel(Posted 2007) [#11]
You mean I shouldn't do quotes?

Yes, that's what I mean.

#2-I can't do that yet. I'm still new at programming and have no idea how.

I know, that's why it's a challenge ;) Break it down into small parts, figure out what the first thing you don't know is, and post for help on it.

Or don't, if you don't want to, it was just a suggestion to help you learn. I always learned by setting myself a challenge to do something I didn't know how to do.


Rob Farley(Posted 2007) [#12]
Graphics 800,600,16,2

Print "Type in the date - example: 40505 is April 5, 2005. "
date$=Input("")
amountindate= Len(date$)
word$=date
find$="13"
location=Instr(word$,find$)

ok = False

If location=0 Then ok = True
If location<>2 And amountindate=5 Then ok = True
If location<>3 And amountindate=6 Then ok = True

If Not ok Then
	friday=Input("Is it Friday? (1 = yes, 0 = no.) ")
	If friday = 0 Then ok = True
EndIf


If Not ok Then
	Print "AAAAAAAAAAAAAAAA!!!!!!!!!!!!!!!!!!!! IT'S FRIDAY THE 13TH!!!!!!!!!!!!!!!!!!!! I GOTTA HIDE!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" 
Else
	Print "Cool."
EndIf

Delay 5000
End



Yo! Wazzup?(Posted 2007) [#13]
Ok...That looks easier to do. And I get what every line of code means. But I'm not used to that. I'll try to get used to it, though.