View unanswered posts | View active topics It is currently Fri Sep 18, 2020 7:25 pm

Reply to topic  [ 3 posts ] 
VEX Alarm Clock Challenge, or the... 
Author Message
Site Admin
Site Admin

Joined: Thu May 24, 2012 12:15 pm
Posts: 722
Post VEX Alarm Clock Challenge, or the...
"I couldn't think of a more original name for this!" Challenge.

Alarm clocks. We have them, we use them, and we eventually grow to hate them. Those annoying little monstrosities are the source of our continued employment and the slayer of our peaceful rest. To help ease the pain of having your serene slumber shattered by a blaring siren, we’ve created a program that will turn a VEX Cortex (with a LCD screen attached) into a basic alarm clock (code attached).

Here’s the catch; although the code is correct and will work, it is very poorly written. It’s all in task main running straight through with little room for flexibility; there are no functions or multitasking involved. Clearly, this is sub-optimal code.

This is where you come in. We would like you, the ROBOTC community, to showcase how you would rewrite the code to make it better. Where can it be improved? What can be cut out? Where can it be more flexible? The fun doesn’t stop there, though (we can’t make this easy now, can we?): the challenge is to showcase the different styles and approaches to coding, so we’d like to see what you can come up with.

-How to make the most streamlined code (fewest lines, for instance)
-How to make the most flexible code (switching out 12 hour to 24 time format, etc)
-Who can make the most ‘inventive’ code (one idea was to make the robot ‘run away’ from the groggy user trying to shut the alarm off :twisted: )

We want to see what the community can come up with, the processes involved, the pros and cons of various coding styles, etc. More importantly, we want this to be a fun learning experience for all involved, and to that end we encourage this to be an open brainstorming session.

Good luck, and happy coding!

File comment: This is the long, uncut version of the Alarm Clock program for VEX Cortex.
Alarm_Clock_One_Task.c [8.34 KiB]
Downloaded 1871 times

*This is a sister challenge to the NXT Alarm Clock Challenge

Check out our Blog! And our Facebook page!
Need help? Take a look at our updated help documentation and the ROBOTC Forums.

Last edited by JohnWatson on Mon Apr 15, 2013 9:09 am, edited 1 time in total.

Fri Jul 20, 2012 1:38 pm
User avatar

Joined: Fri Aug 24, 2012 8:28 pm
Posts: 6
Post Re: VEX Alarm Clock Challenge, or the...
I quickly wrote this, however I have NO idea if it works or not, I have no way to testing it. There's nothing really special about it yet.. I'll start brainstorming some unique ideas for it and re-upload a new version later =P

Generally I would like to have split this into 2 or 3 files, one being the main task and the other for the functions (and for bigger projects, another for the variables), but just so it's simple to upload/download, I put it into one file.

My coding style has diffidently grown into something pretty solid (I think) this summer, but I'll of course take any tips on how to organize/write everything better.

EDIT: Will the code
work correctly? I found some examples and it looks like it's possible to do stringA==stringB, but I just want to be sure.


File comment: Code
Alarm_Clock_One_Task (1).c [5.3 KiB]
Downloaded 604 times
Fri Aug 24, 2012 8:39 pm

Joined: Thu Nov 01, 2012 3:00 pm
Posts: 1
Post Re: VEX Alarm Clock Challenge, or the...
I don't understand

Thu Nov 01, 2012 3:03 pm
Display posts from previous:  Sort by  
Reply to topic   [ 3 posts ] 

Who is online

Users browsing this forum: No registered users and 2 guests

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.