Форум программистов, компьютерный форум, киберфорум
Pascal (Паскаль)
Войти
Регистрация
Восстановить пароль
Блоги Сообщество Поиск Заказать работу  
 
Рейтинг 4.91/11: Рейтинг темы: голосов - 11, средняя оценка - 4.91
0 / 0 / 0
Регистрация: 15.11.2009
Сообщений: 5

Будильник, усовершенствовать как бы?

15.11.2009, 23:32. Показов 2334. Ответов 8
Метки нет (Все метки)

Студворк — интернет-сервис помощи студентам
Здравствуйте уважаемые программисты!!!, вот имеется цифровой будильник, можно его как нибуть улучшить путём изменения внешнего вида, т.е. сделать 4 цифровых разряда часы и минуты а секунды (5-6разряд) сделать мигающими. А для будильника что б его можно было включить и выключить при возможности что бы для будильника была отдельная кнопочка для его настройки(вкл/выкл/изменить время).
код программы:
Pascal
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
uses crt,dos;
var regs:registers;
    h,m,s,h1,m1,s1:byte;
procedure cursoroff;assembler;
asm mov ah,1
    mov ch,20h
    int 10h
end;
procedure alarm;
var f:integer;
begin clrscr;
      gotoxy(24,12);
      textcolor(lightred);
      writeln('nagmite klavichu chtobi ostanivit chasi ...');
      cursoroff;
      repeat f:=695;
             sound(f);
             delay(100);
      while f>671 do
      begin dec(f);
            sound(f);
            delay(100);
      end;
      f:=588;
      sound(f);
      delay(300);
      while f<610 do
      begin sound(f);
            delay(150);
            inc(f);
      end;
      until keypressed;
      nosound;
end;
begin textbackground(black);
      clrscr;
      textcolor(lightblue);
      repeat gotoxy(57,10);write('         ');
             gotoxy(14,10);
             write('Vvedite chas budilnika (0...23) : ');
             readln(h);
      until (h>=0)and(h<24);
      repeat gotoxy(57,12);write('         ');
             gotoxy(14,12);
             write('Enter minutes of your alarm-clock (0...59) : ');
             readln(m);
      until (m>=0)and(m<60);
      repeat gotoxy(57,14);write('         ');
             gotoxy(14,14);
             write('Enter seconds of your alarm-clock (0...59) : ');
             readln(s);
      until (s>=0)and(s<60);
      clrscr;
      gotoxy(20,3);
      textcolor(lightmagenta);
      gotoxy(23,12);
      write('Time in your BIOS-clock now is  ');
      textcolor(yellow);
      gotoxy(25,10);
      write('Alarm-clock been starting at ');
      if h<10 then write('0',h,':')
      else write(h,':');
      if m<10 then
      write('0',m,':')
      else write(m,':');
      if s<10 then
      write('0',s)
      else write(s);
      textcolor(green);
      gotoxy(16,14);
      writeln('Press any key for exit before alarm-clock been started.');
repeat
regs.ah:=$2c;
intr($21,regs);
with regs do
begin gotoxy(54,12);
textcolor(lightmagenta);
h1:=ch;
if ch<10 then write('0',ch,':')
else write(ch,':');
m1:=cl;
if cl<10 then
write('0',cl,':')
else write(cl,':');
s1:=dh;
if dh<10 then
write('0',dh)
else write(dh);
end;
cursoroff;
until (keypressed)or((h=h1)and(m=m1)and(s=s1));
if ((h=h1)and(m=m1)and(s=s1)) then alarm;
end.
подскажите хоть чтонибуть
0
Programming
Эксперт
39485 / 9562 / 3019
Регистрация: 12.04.2006
Сообщений: 41,671
Блог
15.11.2009, 23:32
Ответы с готовыми решениями:

Как сделать реагирование будильник в PascalABC.Net?
Сами часы уже есть. Но надо, чтобы были и кнопки, которыми можно было бы добавить любое количество сигналов и удалить также. Проблема в...

Что в этой программе можно изменить (что бы улучшить) И как ее усовершенствовать ?
Program Kalkulator ; Label m1,m2; Var Operation,cal:byte; a,b:real; Begin m1: Writeln('1-сложить'); ...

Усовершенствовать будильник на Delphi
Всем привет, нужна помощь в усовершенствовании будильника на Delphi. Сейчас он показывает текущее время, можно выбирать время звонка и...

8
2 / 2 / 0
Регистрация: 02.11.2009
Сообщений: 19
15.11.2009, 23:39
а че именно паскаль обязательно приключение искать ведь есть более легкии путь
0
0 / 0 / 0
Регистрация: 15.11.2009
Сообщений: 5
15.11.2009, 23:43  [ТС]
ну раз его изучаю в политехе приходится мучаться с этим програмным продуктом
0
2 / 2 / 0
Регистрация: 02.11.2009
Сообщений: 19
15.11.2009, 23:54
познаи темную сторону силы юный СкайВокер

Добавлено через 4 минуты
короче паузу можно зделать так примерно
при нажатий keypress #13(или что еще)остановить отчет
if keypress=#13 then
что то вроле такого
0
0 / 0 / 0
Регистрация: 15.11.2009
Сообщений: 5
16.11.2009, 12:07  [ТС]
как я понимаю никто ничего незнает?
0
Почетный модератор
 Аватар для Puporev
64314 / 47610 / 32743
Регистрация: 18.05.2008
Сообщений: 115,168
16.11.2009, 13:06
kel, И как ты догадался! Именно никто ничего. А вот напиши в раздел Фриланс, сразу все все знают. Думаешь охота кому-то ковыряться в твоем маразме? Да лучше десятку других решить более адекватные и менее энергоемкие задачи.
0
Retired
7727 / 2559 / 671
Регистрация: 17.10.2009
Сообщений: 5,100
16.11.2009, 13:29
Цитата Сообщение от kel Посмотреть сообщение
можно его как нибуть улучшить?

Не по теме:

чтобы он еще и погоду показывал?:D

0
0 / 0 / 0
Регистрация: 15.11.2009
Сообщений: 5
22.11.2009, 22:02  [ТС]
ответов положительных от вас недождаться
0
0 / 0 / 0
Регистрация: 15.11.2009
Сообщений: 5
03.12.2009, 22:08  [ТС]
Вот тут помогли добрые люди модернизировать, конечно не так как я немнога хотел но всё же лучше, пишите отзывы
Pascal
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
uses crt,dos,graph;
var regs:registers;
    h,m,s,h1,m1,s1:integer;
    Gd, Gm, Size,t:integer;
    cha:char;
    time,timeB:string;
{procedure cursoroff;assembler;
asm mov ah,1
    mov ch,20h
    int 10h
end;
}
procedure alarm;
var f,col:integer;
begin
{ clrscr;}
 setcolor(black);
 bar(0,0,getmaxx,getmaxy-TextWidth(' '));
 randomize;
 repeat
  col:=random(16);
  settextstyle(0,0,Size*2);
  setcolor(lightred);
  outtextxy((getmaxx div 2) - (textwidth('BUM!!!BUM!!!BUM!!!') div 2),
            (getmaxy div 2) - (textheight('BUM!!!BUM!!!BUM!!!') div 2),
            'BUM!!!BUM!!!BUM!!!');
  f:=695;
  sound(f);
  delay(100);
  while f>671 do
        begin
         dec(f);
         sound(f);
         delay(100);
        end;
  f:=588;
  sound(f);
  delay(300);
  while f<610 do
        begin
         sound(f);
         delay(150);
         inc(f);
        end;
 until keypressed;
 nosound;
end;
 
Function IntToStr(I : Longint) : String;
{ ЏаҐ®Ўа*§®ўлў*Ґв §**зҐ*ЁҐ вЁЇ* Integer ў бва®Єг }
Var S : String [11];
Begin
 Str(I, S);
 IntToStr:=S;
End;
 
 
 
begin
 Gd:=Detect;
 InitGraph(Gd, Gm, 'egavga.bgi');
 If GraphResult <> grOk Then Halt(1);
 Size:=2;
 h:=0;m:=0;s:=0;
 settextstyle(0,0,Size);
 setcolor(lightred);
 outtextxy((getmaxx div 2) - (textwidth('HH = 00') div 2),
           (getmaxy div 4)*1 - (textheight('HH = 00') div 2),'HH = 00');
 setcolor(lightblue);
 outtextxy((getmaxx div 2) - (textwidth('MM = 00') div 2),
           (getmaxy div 4)*2 - (textheight('MM = 00') div 2),'MM = 00');
 outtextxy((getmaxx div 2) - (textwidth('SS = 00') div 2),
           (getmaxy div 4)*3 - (textheight('SS = 00') div 2),'SS = 00');
 setcolor(green);
 outtextxy((getmaxx div 2) - (textwidth('Press Enter to continue...') div 2),
           getmaxy-textheight('Press Enter to continue...'),
          'Press Enter to continue...');
 setcolor(LightGray);
 outtextxy((getmaxx div 2) - (textwidth('Press Up,Down,Left,Right to Move...') div 2),
           0,
          'Press Up,Down,Left,Right to Move...');
 t:=1;
 repeat
 cha:=readkey;
 case cha of
  #72:{up}
   begin
    dec(t);
    if t=0 then t:=3;
   end;
  #80: {down}
   begin
    inc(t);
    if t=4 then t:=1;
   end;
  #75: {left}
   begin
    case t of
     1: {HH}
      begin
       dec(h);
       if(h=-1) then h:=23;
      end;
     2: {MM}
      begin
       dec(m);
       if(m=-1) then m:=59;
      end;
     3: {SS}
      begin
       dec(s);
       if(s=-1) then s:=59;
      end;
     end;
   end;
  #77: {right}
   begin
    case t of
     1: {HH}
      begin
       inc(h);
       if(h=24) then h:=0;
      end;
     2: {MM}
      begin
       inc(m);
       if(m=60) then m:=0;
      end;
     3: {SS}
      begin
       inc(s);
       if(s=60) then s:=0;
      end;
     end;
   end;
(*  #32: {space}
   begin
   end;
  #13: {enter}
   begin
   end;
  #27: {escape}
   begin
   end;*)
 end; {end case ch of}
 setcolor(black);
 outtextxy((getmaxx div 2) - (textwidth('HH = 00') div 2),
           (getmaxy div 4)*1 - (textheight('HH = 00') div 2),'HH = ЫЫ');
 outtextxy((getmaxx div 2) - (textwidth('MM = 00') div 2),
           (getmaxy div 4)*2 - (textheight('MM = 00') div 2),'MM = ЫЫ');
 outtextxy((getmaxx div 2) - (textwidth('SS = 00') div 2),
           (getmaxy div 4)*3 - (textheight('SS = 00') div 2),'SS = ЫЫ');
 case t of
  1:
    begin
     setcolor(lightred);
     if (h<10) then
     outtextxy((getmaxx div 2) - (textwidth('HH = 00') div 2),
           (getmaxy div 4)*1 - (textheight('HH = 00') div 2),'HH = 0'+IntToStr(h))
     else
     outtextxy((getmaxx div 2) - (textwidth('HH = 00') div 2),
           (getmaxy div 4)*1 - (textheight('HH = 00') div 2),'HH = '+IntToStr(h));
     setcolor(lightblue);
     if (m<10) then
     outtextxy((getmaxx div 2) - (textwidth('MM = 00') div 2),
           (getmaxy div 4)*2 - (textheight('MM = 00') div 2),'MM = 0'+IntToStr(m))
     else
     outtextxy((getmaxx div 2) - (textwidth('MM = 00') div 2),
           (getmaxy div 4)*2 - (textheight('MM = 00') div 2),'MM = '+IntToStr(m));
     if (s<10) then
     outtextxy((getmaxx div 2) - (textwidth('SS = 00') div 2),
           (getmaxy div 4)*3 - (textheight('SS = 00') div 2),'SS = 0'+IntToStr(s))
     else
     outtextxy((getmaxx div 2) - (textwidth('SS = 00') div 2),
           (getmaxy div 4)*3 - (textheight('SS = 00') div 2),'SS = '+IntToStr(s))
    end;
  2:
    begin
     setcolor(lightred);
     if (m<10) then
     outtextxy((getmaxx div 2) - (textwidth('MM = 00') div 2),
           (getmaxy div 4)*2 - (textheight('MM = 00') div 2),'MM = 0'+IntToStr(m))
     else
     outtextxy((getmaxx div 2) - (textwidth('MM = 00') div 2),
           (getmaxy div 4)*2 - (textheight('MM = 00') div 2),'MM = '+IntToStr(m));
     setcolor(lightblue);
     if (h<10) then
     outtextxy((getmaxx div 2) - (textwidth('HH = 00') div 2),
           (getmaxy div 4)*1 - (textheight('HH = 00') div 2),'HH = 0'+IntToStr(h))
     else
     outtextxy((getmaxx div 2) - (textwidth('HH = 00') div 2),
           (getmaxy div 4)*1 - (textheight('HH = 00') div 2),'HH = '+IntToStr(h));
     if (s<10) then
     outtextxy((getmaxx div 2) - (textwidth('SS = 00') div 2),
           (getmaxy div 4)*3 - (textheight('SS = 00') div 2),'SS = 0'+IntToStr(s))
     else
     outtextxy((getmaxx div 2) - (textwidth('SS = 00') div 2),
           (getmaxy div 4)*3 - (textheight('SS = 00') div 2),'SS = '+IntToStr(s))
    end;
  3:
    begin
     setcolor(lightred);
     if (s<10) then
     outtextxy((getmaxx div 2) - (textwidth('SS = 00') div 2),
           (getmaxy div 4)*3 - (textheight('SS = 00') div 2),'SS = 0'+IntToStr(s))
     else
     outtextxy((getmaxx div 2) - (textwidth('SS = 00') div 2),
           (getmaxy div 4)*3 - (textheight('SS = 00') div 2),'SS = '+IntToStr(s));
     setcolor(lightblue);
     if (m<10) then
     outtextxy((getmaxx div 2) - (textwidth('MM = 00') div 2),
           (getmaxy div 4)*2 - (textheight('MM = 00') div 2),'MM = 0'+IntToStr(m))
     else
     outtextxy((getmaxx div 2) - (textwidth('MM = 00') div 2),
           (getmaxy div 4)*2 - (textheight('MM = 00') div 2),'MM = '+IntToStr(m));
     if (h<10) then
     outtextxy((getmaxx div 2) - (textwidth('HH = 00') div 2),
           (getmaxy div 4)*1 - (textheight('HH = 00') div 2),'HH = 0'+IntToStr(h))
     else
     outtextxy((getmaxx div 2) - (textwidth('HH = 00') div 2),
           (getmaxy div 4)*1 - (textheight('HH = 00') div 2),'HH = '+IntToStr(h))
    end;
 end;
until(cha=#13);
 setcolor(black);
 outtextxy((getmaxx div 2) - (textwidth('HH = 00') div 2),
           (getmaxy div 4)*1 - (textheight('HH = 00') div 2),'HH = ЫЫ');
 outtextxy((getmaxx div 2) - (textwidth('MM = 00') div 2),
           (getmaxy div 4)*2 - (textheight('MM = 00') div 2),'MM = ЫЫ');
 outtextxy((getmaxx div 2) - (textwidth('SS = 00') div 2),
           (getmaxy div 4)*3 - (textheight('SS = 00') div 2),'SS = ЫЫ');
 outtextxy((getmaxx div 2) - (textwidth('Press Enter to continue...') div 2),
           getmaxy-textheight('Press Enter to continue...'),
          'Press Enter to continue...');
 outtextxy((getmaxx div 2) - (textwidth('Press Up,Down,Left,Right to Move...') div 2),
           0,
          'Press Up,Down,Left,Right to Move...');
 
 
 
 time:='';
 if h<10 then time:=time+'0'+IntToStr(h)+':'
 else time:=time+IntToStr(h)+':';
 if m<10 then time:=time+'0'+IntToStr(m)+':'
 else time:=time+IntToStr(m)+':';
 if s<10 then time:=time+'0'+IntToStr(s)
 else time:=time+IntToStr(s);
 
 
 setcolor(lightmagenta);
 outtextxy((getmaxx div 2) - (textwidth('START - '+time) div 2),
           (getmaxy div 3)-textheight('START - '+time),
          'START - '+time);
 
 setcolor(green);
 outtextxy((getmaxx div 2) - (textwidth('Press any key to exit...') div 2),
           getmaxy-textheight('Press any key to exit...'),
          'Press any key to exit...');
repeat
 setcolor(black);
 outtextxy((getmaxx div 2) - (textwidth('ЫЫ:ЫЫ:ЫЫ') div 2),
           (getmaxy div 3)*2-textheight('ЫЫ:ЫЫ:ЫЫ'),
          'ЫЫ:ЫЫ:ЫЫ');
 regs.ah:=$2c;
 intr($21,regs);
 with regs do
 begin
  h1:=ch;
  m1:=cl;
  s1:=dh;
 timeB:='';
 if h1<10 then timeB:=timeB+'0'+IntToStr(h1)+':'
 else timeB:=timeB+IntToStr(h1)+':';
 if m1<10 then timeB:=timeB+'0'+IntToStr(m1)+':'
 else timeB:=timeB+IntToStr(m1)+':';
 if s1<10 then timeB:=timeB+'0'+IntToStr(s1)
 else timeB:=timeB+IntToStr(s1);
 setcolor(yellow);
 outtextxy((getmaxx div 2) - (textwidth(timeB) div 2),
           (getmaxy div 3)*2-textheight(timeB),
          timeB);
 delay(500);
end;
{cursoroff;}
until (keypressed)or((h=h1)and(m=m1)and(s=s1));
if ((h=h1)and(m=m1)and(s=s1)) then alarm;
closegraph;
end.
0
Надоела реклама? Зарегистрируйтесь и она исчезнет полностью.
inter-admin
Эксперт
29715 / 6470 / 2152
Регистрация: 06.03.2009
Сообщений: 28,500
Блог
03.12.2009, 22:08
Помогаю со студенческими работами здесь

Как усовершенствовать калькулятор ?
Всем привет,недавно начал изучать c++ и решил сделать свой калькулятор с вводом любого выражения, с двумя переменными все работает...

Как усовершенствовать алгоритм (архивация/сжатие/распаковка)?
Архивация public static void Zip(string FileRes, string FileDest) { FileStream fs = null; //исходный файл ...

Как усовершенствовать программу?
Доброго времени суток! Начал изучать с++,написал простенькую прогу чтобы попрактиковаться,хотелось бы узнать как можно ещё более...

Как усовершенствовать алгоритм?
Здравствуйте. Есть такой код: for(int i = 0; i &lt; WORDS-&gt;Count; i++) { flag = false; for(int j = 0; j &lt;...

Как усовершенствовать транслит
Здравствуйте. Я не знаю как усовершенствовать транслит. У меня есть форма, на которой расположены два мемо (один для ввода текста, другой...


Искать еще темы с ответами

Или воспользуйтесь поиском по форуму:
9
Ответ Создать тему
Новые блоги и статьи
http://iceja.net/ сервер решения полиномов
iceja 18.01.2026
Выкатила http:/ / iceja. net/ сервер решения полиномов (находит действительные корни полиномов методом Штурма). На сайте документация по API, но скажу прямо VPS слабенький и 200 000 полиномов. . .
Первый деплой
lagorue 16.01.2026
Не спеша развернул своё 1ое приложение в kubernetes. А дальше мне интересно создать 1фронтэнд приложения и 2 бэкэнд приложения развернуть 2 деплоя в кубере получится 2 сервиса и что-бы они. . .
Расчёт переходных процессов в цепи постоянного тока
igorrr37 16.01.2026
/ * Дана цепь постоянного тока с R, L, C, k(ключ), U, E, J. Программа составляет систему уравнений по 1 и 2 законам Кирхгофа, решает её и находит: токи, напряжения и их 1 и 2 производные при t = 0;. . .
Восстановить юзерскрипты Greasemonkey из бэкапа браузера
damix 15.01.2026
Если восстановить из бэкапа профиль Firefox после переустановки винды, то список юзерскриптов в Greasemonkey будет пустым. Но восстановить их можно так. Для этого понадобится консольная утилита. . .
Изучаю kubernetes
lagorue 13.01.2026
А пригодятся-ли мне знания kubernetes в России?
Сукцессия микоризы: основная теория в виде двух уравнений.
anaschu 11.01.2026
https:/ / rutube. ru/ video/ 7a537f578d808e67a3c6fd818a44a5c4/
WordPad для Windows 11
Jel 10.01.2026
WordPad для Windows 11 — это приложение, которое восстанавливает классический текстовый редактор WordPad в операционной системе Windows 11. После того как Microsoft исключила WordPad из. . .
Classic Notepad for Windows 11
Jel 10.01.2026
Old Classic Notepad for Windows 11 Приложение для Windows 11, позволяющее пользователям вернуть классическую версию текстового редактора «Блокнот» из Windows 10. Программа предоставляет более. . .
КиберФорум - форум программистов, компьютерный форум, программирование
Powered by vBulletin
Copyright ©2000 - 2026, CyberForum.ru