اللغات

لوحة المفاتيح

Tagged Union

Exhaustive handling of a discriminated type.

الصعوبة: متوسط · 15 الأسطر · الرخصة: public-domain

الوقت المتبقي5:00
النقاط0
لاعب تلقائيRapidCipher489
type Shape =
  | { kind: 'circle'; radius: number }
  | { kind: 'square'; side: number }
  | { kind: 'rectangle'; width: number; height: number };
function area(shape: Shape): number {
  switch (shape.kind) {
    case 'circle':
      return Math.PI * shape.radius ** 2;
الوقت0:00
السرعة (WPM)0.0
الدقة100.0%
الأخطاء0

لوحة المفاتيح المباشرة

المفتاح التالي: T | آخر مفتاح: -

التقدم: 0.0%
ذ
١
٢
٣
٤
٥
٦
٧
٨
٩
٠
-
=
ض
ص
ث
ق
ف
غ
ع
ه
خ
ح
ج
د
ش
س
ي
ب
ل
ا
ت
ن
م
ك
ط
ئ
ء
ؤ
ر
لا
ى
ة
و
ز
ظ
T
مسافة

لوحة المتصدرين

لا توجد نتائج بعد.