PhoenixBoy פורסם 2004 בדצמבר 6 Share פורסם 2004 בדצמבר 6 רשמתי תוכנה בפסקל והוא רושם לי בעיה הנה הקוד מקור:הוא טוען שיש שגיאה ב-end האחרון... מה לעשות?program project;var con, points : integer;function hisur:integer;var n1, n2, result, i, l : integer;begin writeln('Choose a level from 1-5.'); readln(l); n1 := random(10)+1+(l-1)*10; n2 := random(10)+1+(l-1)*10; writeln(n1, '-', n2, '='); i := 1; while i <= 3 do begin readln(result); if result = n1 - n2 then begin writeln('Correct.'); i := 4; hisur := 1; end else begin writeln('Wrong.'); i := i+1; if i = 4 then hisur := 0 else writeln('Try again.'); end; end;end;function hibur:integer;var n1, n2, result, i, l : integer;begin writeln('Choose a level from 1-5.'); readln(l); n1 := random(10)+1+(l-1)*10; n2 := random(10)+1+(l-1)*10; writeln(n1, '+', n2, '='); i := 1; while i <= 3 do begin readln(result); if result = n1 + n2 then begin writeln('Correct.'); i := 4; hibur := 1; end else begin writeln('Wrong.'); i := i+1; if i = 4 then hibur := 0 else writeln('Try again.'); end; end;end;function kefel:integer;var n1, n2, result, i, l : integer;begin writeln('Choose a level from 1-5.'); readln(l); n1 := random(10)+1+(l-1)*10; n2 := random(10)+1+(l-1)*10; writeln(n1, '*', n2, '='); i := 1; while i <= 3 do begin readln(result); if result = n1 * n2 then begin writeln('Correct.'); i := 4; kefel := 1; end else begin writeln('Wrong.'); i := i+1; if i = 4 then kefel := 0 else writeln('Try again.'); end; end;end;function hiluk:integer;var n1, n2, result, i, l : integer;begin writeln('Choose a level from 1-5.'); readln(l); n1 := random(10)+1+(l-1)*10; n2 := random(10)+1+(l-1)*10; writeln(n1, '/', n2, '='); i := 1; while i <= 3 do begin readln(result); if result = n1 / n2 then begin writeln('Correct.'); i := 4; hiluk := 1; end else begin writeln('Wrong.'); i := i+1; if i = 4 then hiluk := 0 else writeln('Try again.'); end; end;end;function main_menu:integer;var a : integer;begin writeln('If you want to lehaber, select 1.'); writeln('If you want to lehaser, select 2.'); writeln('If you want to likfol, select 3.'); writeln('If you want to lehalek, select 4.'); readln(a); case a of 1: main_menu := hibur; 2: main_menu := hisur; 3: main_menu := kefel; 4: main_menu := hiluk;end;begin points:=0; writeln('Hello.'); writeln('To continue, enter 1.'); readln(con); while con = 1 do begin points := points + main_menu; writeln('To continue, enter 1.'); end; writeln('Your total score is ', points, '!'); readln;end. קישור לתוכן שתף באתרים אחרים More sharing options...
SupeRnovA פורסם 2004 בדצמבר 6 Share פורסם 2004 בדצמבר 6 התוכן של ה-while וה-if לא אמורים להיות בתוך סוגריים?וגם תנסה להשתמש בdebuger. אולי זה יעזור לך. קישור לתוכן שתף באתרים אחרים More sharing options...
PhoenixBoy פורסם 2004 בדצמבר 6 מחבר Share פורסם 2004 בדצמבר 6 התוכן של ה-while וה-if לא אמורים להיות בתוך סוגריים?וגם תנסה להשתמש בdebuger. אולי זה יעזור לך.ניסיתי כבר עם ה-debugger הוא אומר על ה-end האחרון שכאילו צריך להיות ; אבל זה לא עוזר... קישור לתוכן שתף באתרים אחרים More sharing options...
bla7 פורסם 2004 בדצמבר 6 Share פורסם 2004 בדצמבר 6 באמת שכחת END אחד... תספור פשוט כמה BEGIN יש וכמה END יש ותראה... קישור לתוכן שתף באתרים אחרים More sharing options...
SupeRnovA פורסם 2004 בדצמבר 7 Share פורסם 2004 בדצמבר 7 באמת שכחת ;end אחרי השורה הלפני האחרונה (;readln)שכחת לסגור את הפונק'. כנראה התבלבלת אם הend של הפונ' לend של התוכנית. קישור לתוכן שתף באתרים אחרים More sharing options...
PhoenixBoy פורסם 2004 בדצמבר 7 מחבר Share פורסם 2004 בדצמבר 7 מישהו יכול לרשום כאן את הקוד עם התיקון? קישור לתוכן שתף באתרים אחרים More sharing options...
moses_23 פורסם 2004 בדצמבר 9 Share פורסם 2004 בדצמבר 9 program project;var con, points : integer;function hisur:integer;var n1, n2, result, i, l : integer;begin writeln('Choose a level from 1-5.'); readln(l); n1 := random(10)+1+(l-1)*10; n2 := random(10)+1+(l-1)*10; writeln(n1, '-', n2, '='); i := 1; while i <= 3 do begin readln(result); if result = n1 - n2 then begin writeln('Correct.'); i := 4; hisur := 1; end; else begin writeln('Wrong.'); i := i+1; if i = 4 then hisur := 0 else writeln('Try again.'); end; end;end;function hibur:integer;var n1, n2, result, i, l : integer;begin writeln('Choose a level from 1-5.'); readln(l); n1 := random(10)+1+(l-1)*10; n2 := random(10)+1+(l-1)*10; writeln(n1, '+', n2, '='); i := 1; while i <= 3 do begin readln(result); if result = n1 + n2 then begin writeln('Correct.'); i := 4; hibur := 1; end; else begin writeln('Wrong.'); i := i+1; if i = 4 then hibur := 0 else writeln('Try again.'); end; end;end;function kefel:integer;var n1, n2, result, i, l : integer;begin writeln('Choose a level from 1-5.'); readln(l); n1 := random(10)+1+(l-1)*10; n2 := random(10)+1+(l-1)*10; writeln(n1, '*', n2, '='); i := 1; while i <= 3 do begin readln(result); if result = n1 * n2 then begin writeln('Correct.'); i := 4; kefel := 1; end; else begin writeln('Wrong.'); i := i+1; if i = 4 then kefel := 0 else writeln('Try again.'); end; end;end;function hiluk:integer;var n1, n2, result, i, l : integer;begin writeln('Choose a level from 1-5.'); readln(l); n1 := random(10)+1+(l-1)*10; n2 := random(10)+1+(l-1)*10; writeln(n1, '/', n2, '='); i := 1; while i <= 3 do begin readln(result); if result = n1 / n2 then begin writeln('Correct.'); i := 4; hiluk := 1; end; else begin writeln('Wrong.'); i := i+1; if i = 4 then hiluk := 0 else writeln('Try again.'); end; end;end;function main_menu:integer;var a : integer;begin writeln('If you want to lehaber, select 1.'); writeln('If you want to lehaser, select 2.'); writeln('If you want to likfol, select 3.'); writeln('If you want to lehalek, select 4.'); readln(a); case a of 1: main_menu := hibur; 2: main_menu := hisur; 3: main_menu := kefel; 4: main_menu := hiluk;end;begin points:=0; writeln('Hello.'); writeln('To continue, enter 1.'); readln(con); while con = 1 do begin points := points + main_menu; writeln('To continue, enter 1.'); end; writeln('Your total score is ', points, '!'); readln;end. שכחת להוסיף ; אחרי כל END מקווה שזו הייתה הבעיה קישור לתוכן שתף באתרים אחרים More sharing options...
rosesr פורסם 2004 בדצמבר 10 Share פורסם 2004 בדצמבר 10 אני לא הכי יודע פסקל אבל אתה אמור בלולאה בתוכנית הראשית לקלוט את CON אחרת זה יהיה לולאה אינ-סופיתמקווה שעזרתי לך ;D קישור לתוכן שתף באתרים אחרים More sharing options...
Recommended Posts
ארכיון
דיון זה הועבר לארכיון ולא ניתן להוסיף בו תגובות חדשות.