עבור לתוכן
View in the app

A better way to browse. Learn more.

HWzone

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

עזרה מהירה בפסקל - Random

Featured Replies

פורסם

למדנו Random בפסקל והמורה אמרה לנו שבשביל שהמחשב ימצא מספרים עשרוניים צריך לכתוב משהו כמו

;X:= Random 0<=X<8

העניין הוא שזה לא פועל - זה כותב שחסר ";" אחרי ה-Random.

אז נראה לי שהמורה התבלבלה או משהו...

אז איך עושים את זה?

פורסם

תנסה לפצל את השורה של 0>=X>8

פעם אחת X קטן מ 8

ופעם X קטן שווה לאפס

פורסם

תשתמש בזה:


<VAR(Integer)>:=<NUM1>+RANDOM(<NUM2>-<NUM1>+1);

זה מחזיר לך מספר רנדומלי בין <NUM1> ל-<NUM2>

(הכי פשוט ככה...)

פורסם
  • מחבר

תראו, זה אמור להראות בערך כמו מה שכתבתי אני מעריך.

ו-The Saint, זה לא פועל ככה...

פורסם

הכל יכול להיות

פעם אחרונה שבאמת כתבתי משהו בפאסקל היה לפני שנתיים וחצי...

:)

פורסם

תנסה לשים את הביטוי (מה שאחרי הרנדום) בסוגריים...

ו..מה רע בשלי?

פורסם
  • מחבר

זה לא פועל בסוגריים...

שלך לא רע, פשוט אני צריך משהו דומה למה שלימדו אותנו :P

נו, תורידו פסקל שנייה מקאזה ותבדקו ;)

פורסם

לא מוריד פסקל... זה מעלה לי סיוטים... סתם...

אין לי כח להוריד... חוץ מזה שהשיטה שלך בכלל לא מוכרת לי, ואפילו לא נראת ממש הגיונית... אבל... יכול להיות...

  • 2 שבועות מאוחר יותר...
פורסם

The random command in pascal has two forms.
1) x=Random(n)+m; -> Gives x a value in the range (m..m+n-1)
2) x=Random; -> Gives x a random floating point value between 0..1
In order to generate a general floating point number between x and y you should write:
t=random*(y-x)+x -> Assuming x is the smallest.

I'm sorry I'm writing in English but I tried to answer the C thing in hebrew and it got all screwed up...
Can somebody tell me how to make a "box" of english text inside hebrew text in here?

פורסם

נסה ליישר לשמאל ע"י הפקודות

(left)

(/left)

* במקום הסוגריים העגולות () שים סוגריים מרובעות [].

פורסם

יותר טוב -> תשתמש בלחצן "קוד" שיש בסרגל כלים בזמן כתיבת הודעה (מסומן בסולמית - # )

הכפתור הזה - code.gif

פורסם

תודה!

תיקנתי, למי שלא הצליח לקרוא...

  • 2 שבועות מאוחר יותר...
פורסם

:

try to write

randomize:

random (x); and then

insted ot the x write number

for exampe 10 and the computer will write

number form 0 to 9

ארכיון

דיון זה הועבר לארכיון ולא ניתן להוסיף בו תגובות חדשות.

דיונים חדשים

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.