DonationCoder.com forum
 
Read-only archive. This is a static copy of the DonationCoder.com forum. Reading and searching work as before; logging in, posting and private messages do not.
Archive of 2026-10-21 · About this archive · Main site

Author Topic: IDEA: Graphic Countdown with Random Reset  (Read 10,550 times)

flisflis

  • Participant
  • Joined in 2007
  • *
  • Posts: 5
IDEA: Graphic Countdown with Random Reset
« on: February 12, 2007, 08:09 PM »
Hello

I have been trying to work on this myself but not very successfully, as I haven't done much of this before.

I need a countdown, starting at 500, which is displayed at 1 second intervals. The countdown is never to reach 0; at random intervals, the countdown restarts. The restart is from a random number between 500 and the current number (I need it to be a little less obvious than restarting from 500 each time).

Ideally I would like the numbers to be displayed as seven-segment digits, like on stop watches, and as large as possible.

Thanks

Crush

  • Hello dude!
  • Member
  • Joined in 2006
  • **
  • Posts: 402
    • Participated in NANY Challenge Three Times
Re: IDEA: Graphic Countdown with Random Reset
« Reply #1 on: February 12, 2007, 08:49 PM »

GREAT IDEA!
...
How to hell could someone use this crazy counter in a senseful way?

flisflis

  • Participant
  • Joined in 2007
  • *
  • Posts: 5
Re: IDEA: Graphic Countdown with Random Reset
« Reply #2 on: February 13, 2007, 12:15 AM »
It's part of an art project looking at avoided endings. I'm not sure if that counts as 'senseful', but it's why.

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,931
    • Gathering Badge
    • Plugin Coding Medal
    • Participated in NANY Challenge Seventeen Times
    • Cody Award
    • Coding Snacks
    • Volunteers/Staff
Re: IDEA: Graphic Countdown with Random Reset
« Reply #3 on: February 13, 2007, 01:35 AM »
easy enough to do.. i'm sure someone will come along and write this up.  would be nice to hear more about your experiment though..

hwtan

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 73
    • Programming School - Stage 1 Medal
    • Programming School - Deluxe Bonus Medal
    • Programming School - Dabbler Medal
    • Coding Snacks
    • Linux User
Re: IDEA: Graphic Countdown with Random Reset
« Reply #4 on: February 13, 2007, 05:07 AM »
You can find the program at http://dcmembers.com/hwt/CodingSnacks/CountDown/CountDown.rar
Source code is available at http://dcmembers.com/hwt/CodingSnacks/CountDown/CountDownSrc.rar

To customize the LEDs, please edit the LED?.gif files in the images directory.  A photoshop image (LED.psd) is included.
To go to full-screen mode, please double-clicked on the digits.


flisflis

  • Participant
  • Joined in 2007
  • *
  • Posts: 5
Re: IDEA: Graphic Countdown with Random Reset
« Reply #5 on: February 13, 2007, 02:14 PM »
Thanks so much!

Unfortunately when I extract this, I get a warning message when I try to run the .exe file:

"Countdown.exe: Unable to locate component
This application has failed to start because MFC71.DLL was not found."

Flis

flisflis

  • Participant
  • Joined in 2007
  • *
  • Posts: 5
Re: IDEA: Graphic Countdown with Random Reset
« Reply #6 on: February 13, 2007, 02:28 PM »
Fixed it!

Sorry, takes me a little longer to work these things out. Art student, and all that. It looks great - you're a star!

Flis

skrommel

  • Fastest code in the west
  • Developer
  • Joined in 2005
  • ***
  • Posts: 933
    • Participated in NANY Challenge Twice
    • Coding Snacks
Re: IDEA: Graphic Countdown with Random Reset
« Reply #7 on: February 13, 2007, 06:08 PM »
:) Or for a proper random, proper restart, transparent, maximized version, try BadCountDown.

Save the script as BadCountDown.ahk, download and install AutoHotkey to run.

It uses ethan's images, so place the images in subfolder called images, and name them LED0.gif through LED9.gif.

Skrommel

Code
;BadCountDown.ahk
; Counts down, but never reaches 0
;Skrommel @2007

#NoEnv
#SingleInstance,Force

firststart=500

Gui,Destroy
Gui,-Border -Caption +ToolWindow +AlwaysOnTop
Gui,Margin,0,0
Gui,Color,FFFFFF
StringSplit,char_,firststart
w:=A_ScreenWidth/char_0
Loop,% char_0
{
  picture:="images\LED" . char_%A_Index% . ".gif"
  Gui,Add,Picture,vpic%A_Index% x+0 yp w%w% h-1,%picture%
}
Gui,Show,,Timer!
WinSet,TransColor,FFFFFF,Timer!

start:=firststart
Loop
{
  If A_Index>1
    Random,start,% start-count,% firststart
  Random,count,1,% start-1
  Loop,% count
  {
    Sleep,999
    number:=start-A_Index+1000000
    StringRight,number,number,StrLen(firststart)
    StringSplit,char_,number
    w:=A_ScreenWidth/char_0
    Loop,% char_0
    {
      picture:="images\LED" . char_%A_Index% . ".gif"
      GuiControl,,pic%A_Index%,%picture%
    }
  }
}
« Last Edit: February 13, 2007, 06:12 PM by skrommel »

flisflis

  • Participant
  • Joined in 2007
  • *
  • Posts: 5
Re: IDEA: Graphic Countdown with Random Reset
« Reply #8 on: February 19, 2007, 09:42 PM »
Thanks!!

Flis

Original address: https://www.donationcoder.com/forum/index.php?topic=7450.0