Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / The DBC Community Clock

Author
Message
Libervurto
20
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 7th Dec 2007 09:44 Edited at: 18th Dec 2007 12:21
I have been looking at a story game on the Geek Culture board, where each person takes it in turns to write a line of the story. It usually turns out like a complete jumble of crap so I thought I'd try and transfer that to programming.

The idea is that we make a clock in DBC.

Rules
1. One line per member.
2. Lines must end with a comment containing the author's user name.
3. The last line is the only line that may be edited, and it can only be edited by its original author.
4. If a line returns an error it may be deleted by any member. Under no other circumstance may a line be deleted (unless it contains offensive material).
5. Any action that is not prohibited is permitted .

I'll get us started


thanks to everyone who takes part,

OBese87

PS: This is NOT a team request

Insert Name Here
19
Years of Service
User Offline
Joined: 20th Mar 2007
Location: Worcester, England
Posted: 7th Dec 2007 19:39
Cool idea!



Sudoku arts, the rabi and Nancy DrewG
Zombie 20
19
Years of Service
User Offline
Joined: 26th Nov 2006
Location: Etters, PA
Posted: 7th Dec 2007 23:06 Edited at: 7th Dec 2007 23:06
Neat, I like it Obese




Coffee coffee coffee coffee coffee coffee cappacino, JAVA!
Dr Schnitzengruber
18
Years of Service
User Offline
Joined: 19th Jul 2007
Location: C:/Projects/failed/ schnitzengruber
Posted: 7th Dec 2007 23:39 Edited at: 7th Dec 2007 23:39


I'm useless as always but I want a space.

Zombie 20
19
Years of Service
User Offline
Joined: 26th Nov 2006
Location: Etters, PA
Posted: 7th Dec 2007 23:59 Edited at: 8th Dec 2007 00:00
crap not allowed , wish I'd waited now.


Coffee coffee coffee coffee coffee coffee cappacino, JAVA!
Libervurto
20
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 8th Dec 2007 00:08
@Dr
You have to write something on your line.

"You must be someone's friend to make comments about them." - MySpace lied.
Dr Schnitzengruber
18
Years of Service
User Offline
Joined: 19th Jul 2007
Location: C:/Projects/failed/ schnitzengruber
Posted: 8th Dec 2007 00:24 Edited at: 8th Dec 2007 00:25
Quote: "@Dr
You have to write something on your line."


Whats with all these restrictions?



Libervurto
20
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 8th Dec 2007 00:26
thanks

"You must be someone's friend to make comments about them." - MySpace lied.
Zombie 20
19
Years of Service
User Offline
Joined: 26th Nov 2006
Location: Etters, PA
Posted: 8th Dec 2007 00:55
I hope we can get some more folks.


Coffee coffee coffee coffee coffee coffee cappacino, JAVA!
TDK
Retired Moderator
23
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 8th Dec 2007 02:06
Sorry guys, but this is a silly idea. In practice I just can't see how it can possibly work.

If I add a For..Next line, how can anyone else have a clue as to what I want to use it for - or even if the same task is being done a different way somewhere else in the program already?

But, please feel free to prove me wrong...

TDK_Man

Libervurto
20
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 8th Dec 2007 02:22
@TDK
I'm not expecting this to work. Everyone has very different styles so it'll be interesting to see if we can make a working program

"You must be someone's friend to make comments about them." - MySpace lied.
Insert Name Here
19
Years of Service
User Offline
Joined: 20th Mar 2007
Location: Worcester, England
Posted: 8th Dec 2007 11:13
Indeed.
And if we need to sync it ever, I'll have written the most important line!


Sudoku arts, the rabi and Nancy DrewG
Latch
19
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 9th Dec 2007 00:36
Also, one line doesn't have to be a single command, right?

(the if a=b line is the one to focus on)
ex:


Enjoy your day.
Gosub
18
Years of Service
User Offline
Joined: 23rd Sep 2007
Location:
Posted: 9th Dec 2007 15:56 Edited at: 9th Dec 2007 15:59
hide mouse : `OBese87
Sync on : `INH
backdrop off: `Zombie20
a#=0 `Gosub

Quote: "do
if a=b then print "A=B!!" : while a=b : inc b : print "Only time through while loop" : endwhile
loop"


Speed in relation to time?



thought a variable
demons breath
22
Years of Service
User Offline
Joined: 4th Oct 2003
Location: Surrey, UK
Posted: 9th Dec 2007 16:10
@Gosub - I think that was just a random piece of code to reinforce what he was saying about how you don't just need one command on a line.



Chose myself a nice simple part of the code to focus on... I'm never going to be able to figure out how to do the trig for the angles that stuff just fries my brain so I thought if I contributed nice and early on I'd at least get included

Insert Name Here
19
Years of Service
User Offline
Joined: 20th Mar 2007
Location: Worcester, England
Posted: 9th Dec 2007 17:16
I fell that i must just say that a#=0 automatically.


Sudoku arts, the rabi and Nancy DrewG
demons breath
22
Years of Service
User Offline
Joined: 4th Oct 2003
Location: Surrey, UK
Posted: 9th Dec 2007 17:29
yeah I didn't quite get the purpose of that line either... I think Gosub just wants to be included. Humour him.

Gosub
18
Years of Service
User Offline
Joined: 23rd Sep 2007
Location:
Posted: 14th Dec 2007 20:46
Quote: "I fell that i must just say that a#=0 automatically."


I never realised that?

Quote: "do
if a=b then print "A=B!!" : while a=b : inc b : print "Only time through while loop" : endwhile
loop"


backdrop off
sync rate 0
do
if b#=a# then inc b#, 1
if b#>a# then inc a#, 1
if b#=60 then b#=0: inc c#,1
if c#=60 then c#=0: inc d#,1
Print C#,":",D#
sync on
loop

Quote: "yeah I didn't quite get the purpose of that line either... I think Gosub just wants to be included. Humour him. "


Why?

thought a variable
Latch
19
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 14th Dec 2007 21:03
Quote: "do
if a=b then print "A=B!!" : while a=b : inc b : print "Only time through while loop" : endwhile
loop"


This isn't code that's part of the clock. This was just an example of cramming several commands on one line.

Enjoy your day.
LBFN
19
Years of Service
User Offline
Joined: 7th Apr 2007
Location: USA
Posted: 14th Dec 2007 21:22
A couple of issues worth mentioning: In DBC, you cannot simply add a rem statement to the end of a line without placing a colon in-between. Also, a# is a float, and should be listed as a#=0.0 as I have done.




LBFN
Roxas
20
Years of Service
User Offline
Joined: 11th Nov 2005
Location: http://forum.thegamecreators.com
Posted: 14th Dec 2007 21:34
Gosub,

Why do you keep listing variables as floats? It just consumes cpu. and slows down your game.


Click For Details!

Gosub
18
Years of Service
User Offline
Joined: 23rd Sep 2007
Location:
Posted: 14th Dec 2007 22:29
Quote: "Why do you keep listing variables as floats? It just consumes cpu. and slows down your game."


I havn't found that to be the case.

Quote: "Get Time$()"


If you like using strings.

http://www.youtube.com/v/qzTdExzyH5k&rel=1
Roxas
20
Years of Service
User Offline
Joined: 11th Nov 2005
Location: http://forum.thegamecreators.com
Posted: 14th Dec 2007 22:32
Almost every newbie out there thinks # means integer.. ITS NOT!
Its float darn!!!

a=0 <- Integer allright
a#=0 <- Float allright

Global/Local a as float
a=0 <- Float allright

Global/Local a as byte
a=0 <- Byte allright

Global/Local a as boolean
a=0 <- Boolean allright

etc,etc,etc...

Pisses me off lol


Click For Details!

demons breath
22
Years of Service
User Offline
Joined: 4th Oct 2003
Location: Surrey, UK
Posted: 15th Dec 2007 01:49
Quote: "[quote] "Get Time$()""


If you like using strings.[/quote]

What other way is there of getting the time? I convert them to integers straight afterwards...

LBFN
19
Years of Service
User Offline
Joined: 7th Apr 2007
Location: USA
Posted: 15th Dec 2007 02:56
Gosub
What was your intent on placing the a#=0 in the code in the first place? If you do not need float precision, it should just be an integer. If there is nothing you intend to store in a/a#, then it doesn't even need to be in the code in the first place.

The way Get time$() is done is the correct way. If you add a sync and finish the do-loop and run the program, you will see that the snippet I posted works correctly.

LB
demons breath
22
Years of Service
User Offline
Joined: 4th Oct 2003
Location: Surrey, UK
Posted: 15th Dec 2007 02:59
It would be quite interesting to see what people can come up with to display the time; I doubt working together a line at a time we can come up with something anywhere near as cool as TDK's little funky alarm clock from a recent(ish) DBC challenge

LBFN
19
Years of Service
User Offline
Joined: 7th Apr 2007
Location: USA
Posted: 15th Dec 2007 12:37
I think it is possible to make something cool, but a plan would need to be put in place before people go along simply adding lines of code. For example, if a clock with hands was planned, the code would have taken a very different course already.

LB
TDK
Retired Moderator
23
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 15th Dec 2007 17:18
Quote: "What other way is there of getting the time?"


If you need accuracy, using Timer() is better than Get Time$() as it returns 1000ths of a second rather than Hrs, Mins and Secs.

TDK_Man

Libervurto
20
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 15th Dec 2007 18:49
Quote: "If you need accuracy, using Timer() is better than Get Time$() as it returns 1000ths of a second rather than Hrs, Mins and Secs."

The user would have to set the time first wouldn't they?

demons breath
22
Years of Service
User Offline
Joined: 4th Oct 2003
Location: Surrey, UK
Posted: 15th Dec 2007 19:05
I know the Timer() option, but that's not actual time is it? I'm not exactly sure what it is... I think something to do with how long it is since the system was started or something? That's just a guess... I never need to really use it unless I declare a variable as the timer at the start and take that away from the timer anyway, so it's never really affected me what it actually measures, just that it's measuring in milliseconds...

LBFN
19
Years of Service
User Offline
Joined: 7th Apr 2007
Location: USA
Posted: 15th Dec 2007 20:21
The question about using the timer() to get the time of day was raised before:

http://forum.thegamecreators.com/?m=forum_view&t=48210&b=1

with the response being to use get time$(). My understanding is that timer() will count the microseconds from when the system was powered on.

LB
TDK
Retired Moderator
23
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 15th Dec 2007 21:23
Sorry for being misleading...

What I meant was accuracy for updating the clock - having already got the starting time.

If for example you wanted to write a stop-watch with 10ths of a second, Get Time$() wouldn't be any use as it only updates once per second.

TDK_Man

aluseus GOD
19
Years of Service
User Offline
Joined: 19th Mar 2007
Location: I\'m here. Now I\'m there. I keep moving
Posted: 15th Dec 2007 23:32


alus.portbb.com go there.
Quote: A book. I hate books. book is stupid. I know that I need codes but I dont know the codes -zenicanin14 the 2nd stupidest user in the world
Latch
19
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 16th Dec 2007 07:11
@aluseus
I think your line might be too long. In DBC the maximum length of any single program line is 255 characters. Also comments at the end of a line have to come after a :

Enjoy your day.
Insert Name Here
19
Years of Service
User Offline
Joined: 20th Mar 2007
Location: Worcester, England
Posted: 16th Dec 2007 11:51
... I just noticed something.
Quote: "It usually turns out like a complete jumble of crap so I thought I'd try and transfer that to programming."



Sudoku arts, the rabi and Nancy DrewG
Gosub
18
Years of Service
User Offline
Joined: 23rd Sep 2007
Location:
Posted: 16th Dec 2007 14:25
Quote: "What other way is there of getting the time? I convert them to integers straight afterwards..."


Sequential file access, also good for installing alarms and for the transition of time based upon calendar, like time moving back an hour upon a specific date.

http://www.youtube.com/v/xtmnx6XlyjQ&rel=1
demons breath
22
Years of Service
User Offline
Joined: 4th Oct 2003
Location: Surrey, UK
Posted: 16th Dec 2007 20:08
How does that work? I don't get what you mean...

Mind you I am real tired, didn't get in til 5 last night and it's officially been WAY too long since I've gone a day without drinking so my brain is starting to go a bit slushy I quite possibly wouldn't understand what you meant if you went into more detail so don't worry...

LBFN
19
Years of Service
User Offline
Joined: 7th Apr 2007
Location: USA
Posted: 17th Dec 2007 15:20
@aluseus
The line is too long to be compiled in DBC. Additionally, the character you used for the rem statement is not correct (in addition to needing a colon). What's up with calling yourself GOD anyway? Additionally, the code doesn't work; the 'hands' do not move correctly.

@ Gosub
What in the world are you talking about?

@ DB
There are progams available.....I always thought that booze made your brain slushy, not the lack thereof.


LB
demons breath
22
Years of Service
User Offline
Joined: 4th Oct 2003
Location: Surrey, UK
Posted: 17th Dec 2007 18:16
I meant that I've only had 2 days without drinking in the last couple of weeks and it's starting to have an impact... especially days like saturday when i got home at 5, hence the tiredness and slushybrainness of sunday.

jason p sage
19
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 17th Dec 2007 20:06
this thread is hillarious! I would have joined until I saw multiple commands on one line....

A real brain teaser for the saps trying to add a line near the end - DARN it all! (I wanted to be a sap)

Libervurto
20
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 18th Dec 2007 06:07
It's coming along "nicely", I don't like the last 3 lines, a few too many commands on them.
If someone wants to they could use their turn to delete a line .

LBFN
19
Years of Service
User Offline
Joined: 7th Apr 2007
Location: USA
Posted: 18th Dec 2007 08:04
The last three lines are everything that is inside of the do-loop so far. I understand removing code that produces errors, but since you gave no direction up front, you ought to find a way to work with what is given. I'm not going to take the time to put some code together just to have someone else delete it because you don't like it.

See ya.

LB
Libervurto
20
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 18th Dec 2007 12:07 Edited at: 18th Dec 2007 12:19
I've changed the first post to include the rules. Don't worry they don't screw up anything that has already been written (apart from aluseus' line )



Pixelator
18
Years of Service
User Offline
Joined: 8th Jul 2007
Location: here
Posted: 21st Dec 2007 18:32 Edited at: 21st Dec 2007 18:33



Maryville Game Developers
Visit our website at http://www.freewebs.com/maryville-game-developers/index.htm
demons breath
22
Years of Service
User Offline
Joined: 4th Oct 2003
Location: Surrey, UK
Posted: 21st Dec 2007 19:06
@Pixelator: You what? how does that work?

"A West Texas girl, just like me"
-Bush
Pixelator
18
Years of Service
User Offline
Joined: 8th Jul 2007
Location: here
Posted: 21st Dec 2007 21:44
It subtracts the current number of hours from the total number of hours in 1 year to find out the total number of hours until New years Day!


Maryville Game Developers
Visit our website at http://www.freewebs.com/maryville-game-developers/index.htm
demons breath
22
Years of Service
User Offline
Joined: 4th Oct 2003
Location: Surrey, UK
Posted: 21st Dec 2007 22:05
First off, it subtracts the 2nd part from the 1st, therefore it'll always produce a minus number.

Secondly, hours#=the number of hours through THAT day, not the year.

"A West Texas girl, just like me"
-Bush
aluseus GOD
19
Years of Service
User Offline
Joined: 19th Mar 2007
Location: I\'m here. Now I\'m there. I keep moving
Posted: 22nd Dec 2007 01:55
i just want to clarify why my name has GOD at the end.

It is because I get my name froma mispelling of the japanese name of the god pokemon.

Name in English - arceus
Name in Japanese - aruseus
Misspelling aluseus

I got the name while chatting on a website then I got banned, but the name stuck.

alus.portbb.com go there.
Quote: A book. I hate books. book is stupid. I know that I need codes but I dont know the codes -zenicanin14 the 2nd stupidest user in the world
Libervurto
20
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 22nd Dec 2007 11:08
There is a god pokemon?

Login to post a reply

Server time is: 2026-07-05 14:21:18
Your offset time is: 2026-07-05 14:21:18