├── LICENSE.txt ├── r1 test3.py ├── r1 test1.html ├── o1 test3.py ├── r1 test2.py ├── storytelling-challenge.md ├── arabic-language └── storytelling-challenge.md ├── graphics └── bouncing-ball-square.md ├── prompts_graphics_bouncing-ball-square.md ├── CONTRIBUTING.md ├── o1 test2.py ├── o1 test1.html ├── gpt-4 └── bouncing-ball-example.py ├── outputs_gpt-4_bouncing-ball-example.py ├── CODE_OF_CONDUCT.md ├── evaluation-guidelines.md └── README.md /LICENSE.txt: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2025 Arabic AI Testing Repository Contributors 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /r1 test3.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | import matplotlib.pyplot as plt 3 | import matplotlib.animation as animation 4 | 5 | def julia_set(width, height, c, x_range=(-2, 2), y_range=(-2, 2), max_iter=100): 6 | """Generate Julia set fractal array""" 7 | x = np.linspace(x_range[0], x_range[1], width) 8 | y = np.linspace(y_range[0], y_range[1], height) 9 | X, Y = np.meshgrid(x, y) 10 | Z = X + 1j * Y 11 | fractal = np.zeros(Z.shape, dtype=np.float32) 12 | 13 | for i in range(max_iter): 14 | mask = np.abs(Z) < 10 # Escape radius 15 | Z[mask] = Z[mask]**2 + c 16 | fractal += mask.astype(np.float32) 17 | 18 | return np.log(fractal + 1) 19 | 20 | # Figure setup 21 | fig, ax = plt.subplots(figsize=(8, 8)) 22 | ax.axis('off') 23 | img = ax.imshow(np.random.rand(400, 400), cmap='twilight_shifted', 24 | interpolation='bicubic', vmin=0, vmax=5) 25 | 26 | # Animation parameters 27 | params = { 28 | 'width': 400, 29 | 'height': 400, 30 | 'max_iter': 70, 31 | 'x_range': (-1.5, 1.5), 32 | 'y_range': (-1.5, 1.5) 33 | } 34 | 35 | def init(): 36 | """Initialize animation frame""" 37 | theta = 0 38 | c = 0.7885 * np.exp(1j * theta) 39 | img.set_data(julia_set(c=c, **params)) 40 | return [img] 41 | 42 | def animate(frame): 43 | """Update frame with new Julia set parameters""" 44 | theta = 2 * np.pi * frame / 100 45 | c = 0.7885 * np.exp(1j * theta) 46 | img.set_data(julia_set(c=c, **params)) 47 | return [img] 48 | 49 | # Create animation 50 | anim = animation.FuncAnimation(fig, animate, init_func=init, 51 | frames=100, interval=50, blit=True) 52 | 53 | # Save animation 54 | anim.save('julia_fractal_animation.mp4', writer='ffmpeg', 55 | fps=20, dpi=100, bitrate=2000) 56 | 57 | plt.show() 58 | 59 | # Created/Modified files during execution: 60 | print("julia_fractal_animation.mp4") -------------------------------------------------------------------------------- /r1 test1.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 78 | 79 | -------------------------------------------------------------------------------- /o1 test3.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | import matplotlib.pyplot as plt 3 | import matplotlib.animation as animation 4 | 5 | def julia_set(xmin, xmax, ymin, ymax, width, height, c, max_iter=200): 6 | """ 7 | Generate a 2D array of a Julia set fractal for a specific complex parameter c. 8 | 9 | :param xmin: Minimum x-value in the complex plane 10 | :param xmax: Maximum x-value in the complex plane 11 | :param ymin: Minimum y-value in the complex plane 12 | :param ymax: Maximum y-value in the complex plane 13 | :param width: Number of points along the x-axis for computing 14 | :param height: Number of points along the y-axis for computing 15 | :param c: Complex parameter for the Julia set 16 | :param max_iter: Maximum number of iterations 17 | :return: 2D NumPy array representing the fractal 18 | """ 19 | x = np.linspace(xmin, xmax, width) 20 | y = np.linspace(ymin, ymax, height) 21 | Zx, Zy = np.meshgrid(x, y) 22 | Z = Zx + 1j * Zy 23 | 24 | output = np.zeros(Z.shape, dtype=int) 25 | 26 | # For each point, iterate and see how quickly it diverges 27 | for i in range(max_iter): 28 | mask = np.abs(Z) <= 4 29 | Z[mask] = Z[mask] * Z[mask] + c 30 | output[mask] = i 31 | 32 | return output 33 | 34 | # Animation setup 35 | fig, ax = plt.subplots(figsize=(6, 6)) 36 | plt.axis('off') 37 | 38 | # These define the region of the complex plane we visualize 39 | xmin, xmax = -1.5, 1.5 40 | ymin, ymax = -1.5, 1.5 41 | 42 | width, height = 800, 800 43 | max_iter = 200 44 | 45 | # Initial complex parameter c 46 | c_start = complex(-0.8, 0.156) 47 | # Final complex parameter c 48 | c_end = complex(0.4, -0.3) 49 | 50 | # Generate an initial frame 51 | fractal_data = julia_set(xmin, xmax, ymin, ymax, width, height, c_start, max_iter) 52 | im = ax.imshow(fractal_data, extent=[xmin, xmax, ymin, ymax], origin='lower', cmap='hot') 53 | 54 | def update(frame): 55 | """ 56 | Update function for the animation. We gradually move from c_start to c_end 57 | using linear interpolation over frames to create the “moving” effect. 58 | """ 59 | t = frame / 100 # choose how quickly c changes over frames 60 | c_current = (1 - t) * c_start + t * c_end 61 | 62 | data = julia_set(xmin, xmax, ymin, ymax, width, height, c_current, max_iter) 63 | im.set_data(data) 64 | return [im] 65 | 66 | # Create the animation 67 | ani = animation.FuncAnimation(fig, update, frames=101, interval=50, blit=True) 68 | 69 | # If you want to save the animation (GIF), uncomment the next two lines: 70 | # ani.save("fractal_animation.gif", writer="pillow") 71 | # print("Created/Modified files during execution:\nfractal_animation.gif") 72 | 73 | plt.show() -------------------------------------------------------------------------------- /r1 test2.py: -------------------------------------------------------------------------------- 1 | import pygame 2 | import math 3 | import sys 4 | 5 | # Initialize Pygame 6 | pygame.init() 7 | screen_size = 600 8 | screen = pygame.display.set_mode((screen_size, screen_size)) 9 | clock = pygame.time.Clock() 10 | 11 | # Square parameters 12 | square_center = (screen_size//2, screen_size//2) 13 | square_size = 500 14 | half_square = square_size // 2 15 | square_angle = 0 16 | rotation_speed = 0.5 # Degrees per frame 17 | 18 | # Ball parameters 19 | ball_radius = 20 20 | ball_pos = [screen_size//2, screen_size//2] 21 | ball_vel = [3, 3.5] 22 | ball_color = (255, 255, 0) # Yellow 23 | 24 | def rotate_point(point, angle, center=(0, 0)): 25 | """Rotate a point around a center point by given angle in degrees""" 26 | angle_rad = math.radians(angle) 27 | x, y = point[0] - center[0], point[1] - center[1] 28 | new_x = x * math.cos(angle_rad) - y * math.sin(angle_rad) 29 | new_y = x * math.sin(angle_rad) + y * math.cos(angle_rad) 30 | return (new_x + center[0], new_y + center[1]) 31 | 32 | def check_collision(ball_pos, square_center, square_angle, half_size, radius): 33 | # Convert ball position to square's local coordinate system 34 | dx = ball_pos[0] - square_center[0] 35 | dy = ball_pos[1] - square_center[1] 36 | local_pos = rotate_point((ball_pos[0], ball_pos[1]), -square_angle, square_center) 37 | 38 | # Get local coordinates relative to square center 39 | local_x = local_pos[0] - square_center[0] 40 | local_y = local_pos[1] - square_center[1] 41 | 42 | collisions = [] 43 | 44 | # Check collisions with all walls 45 | if local_x > half_size - radius: 46 | collisions.append(('right', local_x - (half_size - radius))) 47 | elif local_x < -half_size + radius: 48 | collisions.append(('left', local_x - (-half_size + radius))) 49 | 50 | if local_y > half_size - radius: 51 | collisions.append(('bottom', local_y - (half_size - radius))) 52 | elif local_y < -half_size + radius: 53 | collisions.append(('top', local_y - (-half_size + radius))) 54 | 55 | return collisions 56 | 57 | running = True 58 | while running: 59 | for event in pygame.event.get(): 60 | if event.type == pygame.QUIT: 61 | running = False 62 | 63 | # Update square rotation 64 | square_angle += rotation_speed 65 | if square_angle >= 360: 66 | square_angle -= 360 67 | 68 | # Update ball position 69 | ball_pos[0] += ball_vel[0] 70 | ball_pos[1] += ball_vel[1] 71 | 72 | # Check collisions 73 | collisions = check_collision(ball_pos, square_center, square_angle, half_square, ball_radius) 74 | 75 | for collision in collisions: 76 | wall, overlap = collision 77 | 78 | # Calculate collision normal in world coordinates 79 | if wall in ('left', 'right'): 80 | angle = square_angle if wall == 'right' else square_angle + 180 81 | normal = pygame.math.Vector2(1, 0).rotate(angle) 82 | else: 83 | angle = square_angle + 90 if wall == 'bottom' else square_angle - 90 84 | normal = pygame.math.Vector2(1, 0).rotate(angle) 85 | 86 | normal = normal.normalize() 87 | 88 | # Reflect velocity 89 | ball_vel = pygame.math.Vector2(ball_vel) 90 | ball_vel = ball_vel.reflect(normal) 91 | ball_vel = list(ball_vel) 92 | 93 | # Position correction 94 | correction_vec = pygame.math.Vector2(normal) * overlap 95 | ball_pos[0] -= correction_vec.x 96 | ball_pos[1] -= correction_vec.y 97 | 98 | # Draw everything 99 | screen.fill((0, 0, 0)) 100 | 101 | # Draw rotating square 102 | square_surface = pygame.Surface((square_size, square_size), pygame.SRCALPHA) 103 | pygame.draw.rect(square_surface, (255, 255, 255), (0, 0, square_size, square_size), 2) 104 | rotated_square = pygame.transform.rotate(square_surface, square_angle) 105 | rect = rotated_square.get_rect(center=square_center) 106 | screen.blit(rotated_square, rect.topleft) 107 | 108 | # Draw ball 109 | pygame.draw.circle(screen, ball_color, (int(ball_pos[0]), int(ball_pos[1])), ball_radius) 110 | 111 | pygame.display.flip() 112 | clock.tick(60) 113 | 114 | pygame.quit() 115 | sys.exit() 116 | 117 | # Created/Modified files during execution: 118 | # No files are created or modified on disk; all rendering is done in memory and displayed on screen. -------------------------------------------------------------------------------- /storytelling-challenge.md: -------------------------------------------------------------------------------- 1 | # Arabic Storytelling Challenge - Implicit Time Travel 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 | ### المهارات الأساسية (70 نقطة) 31 | 32 | - **دقة اللغة العربية (25 نقطة)** 33 | - استخدام العربية الفصحى الصحيحة 34 | - قواعد النحو والصرف سليمة 35 | - اختيار المفردات المناسبة 36 | 37 | - **الالتزام بالقيود (25 نقطة)** 38 | - كل جملة تحتوي على عشر كلمات بالضبط 39 | - عد الكلمات صحيح ومُبرر 40 | - لا توجد انتهاكات للقيد المحدد 41 | 42 | - **نقل المفهوم الضمني (20 نقطة)** 43 | - إيصال مفهوم السفر عبر الزمن دون ذكره مباشرة 44 | - استخدام الرموز والإشارات الذكية 45 | - تماسك السرد والمعنى الضمني 46 | 47 | ### المهارات الثانوية (30 نقطة) 48 | 49 | - **الإبداع والأصالة (15 نقطة)** 50 | - أفكار مبتكرة ومميزة 51 | - أسلوب سردي جذاب 52 | - تطوير شخصيات وأحداث مقنعة 53 | 54 | - **التحليل والشرح (15 نقطة)** 55 | - تعليقات واضحة ومفيدة 56 | - تبرير الاختيارات اللغوية 57 | - شرح الاستراتيجيات المستخدمة 58 | 59 | ## معايير التقييم المفصلة 60 | 61 | ### ممتاز (90-100 نقطة) 62 | - لغة عربية فصيحة خالية من الأخطاء 63 | - التزام مثالي بقيد العشر كلمات 64 | - نقل بارع للمفهوم الضمني 65 | - إبداع استثنائي في السرد 66 | - تحليل عميق ومدروس 67 | 68 | ### جيد (70-89 نقطة) 69 | - لغة عربية سليمة مع أخطاء طفيفة 70 | - التزام جيد بالقيود مع انحرافات قليلة 71 | - نقل واضح للمفهوم الضمني 72 | - إبداع ملحوظ في السرد 73 | - تحليل مناسب ومفيد 74 | 75 | ### مقبول (50-69 نقطة) 76 | - لغة عربية مفهومة مع بعض الأخطاء 77 | - التزام أساسي بالقيود 78 | - نقل جزئي للمفهوم الضمني 79 | - إبداع محدود 80 | - تحليل أساسي 81 | 82 | ### يحتاج تحسين (0-49 نقطة) 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 | - [مجمع اللغة العربية](http://www.arabacademy.org.eg/) 176 | - [معجم المعاني](https://www.almaany.com/) 177 | - [قواعد النحو العربي](https://www.nahw.org/) 178 | - [أدب السفر عبر الزمن في التراث العربي](https://example.com/arabic-time-travel-literature) 179 | 180 | --- 181 | 182 | **تاريخ الإضافة**: 23 يونيو 2025 183 | **آخر تحديث**: 23 يونيو 2025 184 | **المساهم**: فريق المستودع 185 | -------------------------------------------------------------------------------- /arabic-language/storytelling-challenge.md: -------------------------------------------------------------------------------- 1 | # Arabic Storytelling Challenge - Implicit Time Travel 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 | ### المهارات الأساسية (70 نقطة) 31 | 32 | - **دقة اللغة العربية (25 نقطة)** 33 | - استخدام العربية الفصحى الصحيحة 34 | - قواعد النحو والصرف سليمة 35 | - اختيار المفردات المناسبة 36 | 37 | - **الالتزام بالقيود (25 نقطة)** 38 | - كل جملة تحتوي على عشر كلمات بالضبط 39 | - عد الكلمات صحيح ومُبرر 40 | - لا توجد انتهاكات للقيد المحدد 41 | 42 | - **نقل المفهوم الضمني (20 نقطة)** 43 | - إيصال مفهوم السفر عبر الزمن دون ذكره مباشرة 44 | - استخدام الرموز والإشارات الذكية 45 | - تماسك السرد والمعنى الضمني 46 | 47 | ### المهارات الثانوية (30 نقطة) 48 | 49 | - **الإبداع والأصالة (15 نقطة)** 50 | - أفكار مبتكرة ومميزة 51 | - أسلوب سردي جذاب 52 | - تطوير شخصيات وأحداث مقنعة 53 | 54 | - **التحليل والشرح (15 نقطة)** 55 | - تعليقات واضحة ومفيدة 56 | - تبرير الاختيارات اللغوية 57 | - شرح الاستراتيجيات المستخدمة 58 | 59 | ## معايير التقييم المفصلة 60 | 61 | ### ممتاز (90-100 نقطة) 62 | - لغة عربية فصيحة خالية من الأخطاء 63 | - التزام مثالي بقيد العشر كلمات 64 | - نقل بارع للمفهوم الضمني 65 | - إبداع استثنائي في السرد 66 | - تحليل عميق ومدروس 67 | 68 | ### جيد (70-89 نقطة) 69 | - لغة عربية سليمة مع أخطاء طفيفة 70 | - التزام جيد بالقيود مع انحرافات قليلة 71 | - نقل واضح للمفهوم الضمني 72 | - إبداع ملحوظ في السرد 73 | - تحليل مناسب ومفيد 74 | 75 | ### مقبول (50-69 نقطة) 76 | - لغة عربية مفهومة مع بعض الأخطاء 77 | - التزام أساسي بالقيود 78 | - نقل جزئي للمفهوم الضمني 79 | - إبداع محدود 80 | - تحليل أساسي 81 | 82 | ### يحتاج تحسين (0-49 نقطة) 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 | - [مجمع اللغة العربية](http://www.arabacademy.org.eg/) 176 | - [معجم المعاني](https://www.almaany.com/) 177 | - [قواعد النحو العربي](https://www.nahw.org/) 178 | - [أدب السفر عبر الزمن في التراث العربي](https://example.com/arabic-time-travel-literature) 179 | 180 | --- 181 | 182 | **تاريخ الإضافة**: 23 يونيو 2025 183 | **آخر تحديث**: 23 يونيو 2025 184 | **المساهم**: فريق المستودع 185 | -------------------------------------------------------------------------------- /graphics/bouncing-ball-square.md: -------------------------------------------------------------------------------- 1 | # Bouncing Ball in Rotating Square 2 | 3 | ## Prompt Information 4 | 5 | **Category**: Graphics/Animation 6 | **Difficulty**: ⭐⭐⭐ 7 | **Language**: English 8 | **Skills Tested**: Physics simulation, collision detection, coordinate transformation, graphics programming 9 | 10 | ## Prompt Text 11 | 12 | ``` 13 | Write a Python script for a bouncing yellow ball within a square. 14 | Make sure to handle collision detection properly. Make the square 15 | slowly rotate. Implement it in Python. Ensure the ball stays within 16 | the square. 17 | ``` 18 | 19 | ## Expected Output 20 | 21 | A complete Python script that: 22 | - Creates a graphical window with animation 23 | - Displays a yellow ball bouncing within a square boundary 24 | - Implements proper collision detection with square walls 25 | - Rotates the square slowly and continuously 26 | - Maintains the ball within the rotating square boundaries 27 | - Uses appropriate graphics library (pygame, tkinter, or similar) 28 | 29 | ## Skills Evaluation 30 | 31 | ### Primary Skills (70 points) 32 | - **Physics Simulation (25 points)** 33 | - Realistic ball movement and velocity 34 | - Proper gravity or momentum implementation 35 | - Smooth animation without jitter 36 | 37 | - **Collision Detection (25 points)** 38 | - Accurate detection of ball-wall collisions 39 | - Proper velocity reversal upon collision 40 | - Handling of corner cases and edge collisions 41 | 42 | - **Coordinate Transformation (20 points)** 43 | - Correct rotation of square around center point 44 | - Proper transformation of collision boundaries 45 | - Maintaining ball position relative to rotated square 46 | 47 | ### Secondary Skills (30 points) 48 | - **Code Quality (15 points)** 49 | - Clean, readable code structure 50 | - Appropriate variable naming 51 | - Proper commenting and documentation 52 | 53 | - **Graphics Implementation (15 points)** 54 | - Smooth visual animation 55 | - Appropriate use of graphics library 56 | - Efficient rendering without flickering 57 | 58 | ## Evaluation Criteria 59 | 60 | ### Excellent (90-100 points) 61 | - Perfect collision detection in all scenarios 62 | - Smooth rotation and ball movement 63 | - Clean, well-documented code 64 | - Handles edge cases properly 65 | - Efficient and optimized implementation 66 | 67 | ### Good (70-89 points) 68 | - Collision detection works in most cases 69 | - Minor visual glitches or jerky movement 70 | - Code is functional but may lack optimization 71 | - Basic documentation present 72 | 73 | ### Satisfactory (50-69 points) 74 | - Basic collision detection implemented 75 | - Ball stays mostly within boundaries 76 | - Code runs but may have bugs 77 | - Limited or unclear documentation 78 | 79 | ### Needs Improvement (0-49 points) 80 | - Poor or missing collision detection 81 | - Ball frequently escapes boundaries 82 | - Code has significant bugs or doesn't run 83 | - No documentation or comments 84 | 85 | ## Common Challenges 86 | 87 | ### Technical Challenges 88 | - Implementing rotation transformation matrices 89 | - Handling collision detection in rotated coordinate system 90 | - Maintaining smooth animation frame rate 91 | - Dealing with floating-point precision issues 92 | 93 | ### AI Model Challenges 94 | - Understanding coordinate system transformations 95 | - Balancing multiple requirements (collision + rotation) 96 | - Choosing appropriate graphics libraries 97 | - Implementing smooth animation loops 98 | 99 | ## Sample Test Cases 100 | 101 | ### Test Case 1: Basic Functionality 102 | - Ball should bounce off all four walls 103 | - Square should rotate continuously 104 | - No escape from boundaries 105 | 106 | ### Test Case 2: Edge Cases 107 | - Ball hitting corners should bounce appropriately 108 | - High-speed ball should not pass through walls 109 | - Rotation speed should not affect collision detection 110 | 111 | ### Test Case 3: Performance 112 | - Animation should run smoothly (30+ FPS) 113 | - No memory leaks during extended runtime 114 | - Responsive to user interactions (if any) 115 | 116 | ## Variations 117 | 118 | ### Easier Version (⭐⭐) 119 | ``` 120 | Create a bouncing ball in a stationary square with proper collision detection. 121 | ``` 122 | 123 | ### Harder Version (⭐⭐⭐⭐) 124 | ``` 125 | Create multiple bouncing balls of different colors within a rotating square, 126 | with ball-to-ball collision detection and physics. 127 | ``` 128 | 129 | ### Alternative Focus (⭐⭐⭐) 130 | ``` 131 | Create a bouncing ball within a rotating triangle, ensuring the ball 132 | follows the triangle's rotation and bounces off all three sides. 133 | ``` 134 | 135 | ## Implementation Notes 136 | 137 | ### Recommended Libraries 138 | - **pygame**: Best for game-like animations 139 | - **tkinter**: Simple, built-in Python GUI library 140 | - **matplotlib**: For mathematical visualization approach 141 | - **pyglet**: Advanced graphics and animation 142 | 143 | ### Key Concepts 144 | - Vector mathematics for ball movement 145 | - Rotation matrices for coordinate transformation 146 | - Frame-based animation loops 147 | - Collision response calculations 148 | 149 | ## Related Resources 150 | 151 | - [Pygame Documentation](https://www.pygame.org/docs/) 152 | - [2D Collision Detection Tutorial](https://developer.mozilla.org/en-US/docs/Games/Techniques/2D_collision_detection) 153 | - [Rotation Matrix Mathematics](https://en.wikipedia.org/wiki/Rotation_matrix) 154 | - [Game Physics Basics](https://gafferongames.com/post/integration_basics/) 155 | 156 | --- 157 | 158 | **Added**: June 23, 2025 159 | **Last Updated**: June 23, 2025 160 | **Contributor**: Repository Team 161 | -------------------------------------------------------------------------------- /prompts_graphics_bouncing-ball-square.md: -------------------------------------------------------------------------------- 1 | # Bouncing Ball in Rotating Square 2 | 3 | ## Prompt Information 4 | 5 | **Category**: Graphics/Animation 6 | **Difficulty**: ⭐⭐⭐ 7 | **Language**: English 8 | **Skills Tested**: Physics simulation, collision detection, coordinate transformation, graphics programming 9 | 10 | ## Prompt Text 11 | 12 | ``` 13 | Write a Python script for a bouncing yellow ball within a square. 14 | Make sure to handle collision detection properly. Make the square 15 | slowly rotate. Implement it in Python. Ensure the ball stays within 16 | the square. 17 | ``` 18 | 19 | ## Expected Output 20 | 21 | A complete Python script that: 22 | - Creates a graphical window with animation 23 | - Displays a yellow ball bouncing within a square boundary 24 | - Implements proper collision detection with square walls 25 | - Rotates the square slowly and continuously 26 | - Maintains the ball within the rotating square boundaries 27 | - Uses appropriate graphics library (pygame, tkinter, or similar) 28 | 29 | ## Skills Evaluation 30 | 31 | ### Primary Skills (70 points) 32 | - **Physics Simulation (25 points)** 33 | - Realistic ball movement and velocity 34 | - Proper gravity or momentum implementation 35 | - Smooth animation without jitter 36 | 37 | - **Collision Detection (25 points)** 38 | - Accurate detection of ball-wall collisions 39 | - Proper velocity reversal upon collision 40 | - Handling of corner cases and edge collisions 41 | 42 | - **Coordinate Transformation (20 points)** 43 | - Correct rotation of square around center point 44 | - Proper transformation of collision boundaries 45 | - Maintaining ball position relative to rotated square 46 | 47 | ### Secondary Skills (30 points) 48 | - **Code Quality (15 points)** 49 | - Clean, readable code structure 50 | - Appropriate variable naming 51 | - Proper commenting and documentation 52 | 53 | - **Graphics Implementation (15 points)** 54 | - Smooth visual animation 55 | - Appropriate use of graphics library 56 | - Efficient rendering without flickering 57 | 58 | ## Evaluation Criteria 59 | 60 | ### Excellent (90-100 points) 61 | - Perfect collision detection in all scenarios 62 | - Smooth rotation and ball movement 63 | - Clean, well-documented code 64 | - Handles edge cases properly 65 | - Efficient and optimized implementation 66 | 67 | ### Good (70-89 points) 68 | - Collision detection works in most cases 69 | - Minor visual glitches or jerky movement 70 | - Code is functional but may lack optimization 71 | - Basic documentation present 72 | 73 | ### Satisfactory (50-69 points) 74 | - Basic collision detection implemented 75 | - Ball stays mostly within boundaries 76 | - Code runs but may have bugs 77 | - Limited or unclear documentation 78 | 79 | ### Needs Improvement (0-49 points) 80 | - Poor or missing collision detection 81 | - Ball frequently escapes boundaries 82 | - Code has significant bugs or doesn't run 83 | - No documentation or comments 84 | 85 | ## Common Challenges 86 | 87 | ### Technical Challenges 88 | - Implementing rotation transformation matrices 89 | - Handling collision detection in rotated coordinate system 90 | - Maintaining smooth animation frame rate 91 | - Dealing with floating-point precision issues 92 | 93 | ### AI Model Challenges 94 | - Understanding coordinate system transformations 95 | - Balancing multiple requirements (collision + rotation) 96 | - Choosing appropriate graphics libraries 97 | - Implementing smooth animation loops 98 | 99 | ## Sample Test Cases 100 | 101 | ### Test Case 1: Basic Functionality 102 | - Ball should bounce off all four walls 103 | - Square should rotate continuously 104 | - No escape from boundaries 105 | 106 | ### Test Case 2: Edge Cases 107 | - Ball hitting corners should bounce appropriately 108 | - High-speed ball should not pass through walls 109 | - Rotation speed should not affect collision detection 110 | 111 | ### Test Case 3: Performance 112 | - Animation should run smoothly (30+ FPS) 113 | - No memory leaks during extended runtime 114 | - Responsive to user interactions (if any) 115 | 116 | ## Variations 117 | 118 | ### Easier Version (⭐⭐) 119 | ``` 120 | Create a bouncing ball in a stationary square with proper collision detection. 121 | ``` 122 | 123 | ### Harder Version (⭐⭐⭐⭐) 124 | ``` 125 | Create multiple bouncing balls of different colors within a rotating square, 126 | with ball-to-ball collision detection and physics. 127 | ``` 128 | 129 | ### Alternative Focus (⭐⭐⭐) 130 | ``` 131 | Create a bouncing ball within a rotating triangle, ensuring the ball 132 | follows the triangle's rotation and bounces off all three sides. 133 | ``` 134 | 135 | ## Implementation Notes 136 | 137 | ### Recommended Libraries 138 | - **pygame**: Best for game-like animations 139 | - **tkinter**: Simple, built-in Python GUI library 140 | - **matplotlib**: For mathematical visualization approach 141 | - **pyglet**: Advanced graphics and animation 142 | 143 | ### Key Concepts 144 | - Vector mathematics for ball movement 145 | - Rotation matrices for coordinate transformation 146 | - Frame-based animation loops 147 | - Collision response calculations 148 | 149 | ## Related Resources 150 | 151 | - [Pygame Documentation](https://www.pygame.org/docs/) 152 | - [2D Collision Detection Tutorial](https://developer.mozilla.org/en-US/docs/Games/Techniques/2D_collision_detection) 153 | - [Rotation Matrix Mathematics](https://en.wikipedia.org/wiki/Rotation_matrix) 154 | - [Game Physics Basics](https://gafferongames.com/post/integration_basics/) 155 | 156 | --- 157 | 158 | **Added**: June 23, 2025 159 | **Last Updated**: June 23, 2025 160 | **Contributor**: Repository Team 161 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to Arabic AI Testing Repository 2 | 3 | Thank you for your interest in contributing to our project! This document provides guidelines and information about contributing to the Arabic AI Testing Repository. 4 | 5 | ## 🤝 How to Contribute 6 | 7 | We welcome contributions of all kinds: 8 | - New test prompts 9 | - AI model outputs 10 | - Documentation improvements 11 | - Bug fixes 12 | - Feature suggestions 13 | - Code optimizations 14 | 15 | ## 📋 Getting Started 16 | 17 | 1. **Fork the repository** on GitHub 18 | 2. **Clone your fork** locally: 19 | ```bash 20 | git clone https://github.com/yourusername/arabic-ai-testing.git 21 | cd arabic-ai-testing 22 | ``` 23 | 3. **Create a new branch** for your contribution: 24 | ```bash 25 | git checkout -b feature/your-feature-name 26 | ``` 27 | 28 | ## 🎯 Types of Contributions 29 | 30 | ### 📝 Adding New Prompts 31 | 32 | When adding new test prompts, please follow this structure: 33 | 34 | ```markdown 35 | ## Prompt Title: [Descriptive Name] 36 | 37 | **Category**: [Graphics/Language/Logic/Creative/etc.] 38 | **Difficulty**: ⭐⭐⭐ (1-5 stars) 39 | **Language**: [Arabic/English/Multi] 40 | **Skills Tested**: [List key capabilities] 41 | 42 | ### Prompt Text: 43 | ``` 44 | [Your prompt here] 45 | ``` 46 | 47 | ### Expected Output: 48 | [Description of what successful completion looks like] 49 | 50 | ### Evaluation Criteria: 51 | - [ ] Correctness 52 | - [ ] Creativity 53 | - [ ] Code Quality 54 | - [ ] Language Proficiency (if applicable) 55 | ``` 56 | 57 | ### 💻 Sharing AI Model Outputs 58 | 59 | When sharing code generated by AI models: 60 | 61 | 1. Create a folder structure: `outputs/[model-name]/[prompt-category]/` 62 | 2. Include the complete code output 63 | 3. Add a header comment with: 64 | - Model name and version 65 | - Date of generation 66 | - Original prompt used 67 | - Any notable observations 68 | 69 | Example: 70 | ```python 71 | """ 72 | Generated by: GPT-4 73 | Date: 2025-06-23 74 | Prompt: Bouncing Ball in Rotating Square 75 | Notes: Excellent collision detection, smooth animation 76 | """ 77 | 78 | # Your code here... 79 | ``` 80 | 81 | ### 📚 Documentation Improvements 82 | 83 | Help improve our documentation by: 84 | - Fixing typos and grammar 85 | - Adding clearer explanations 86 | - Translating content to other languages 87 | - Creating tutorials and examples 88 | 89 | ## 📁 Repository Structure 90 | 91 | Please follow this organization when adding files: 92 | 93 | ``` 94 | arabic-ai-testing/ 95 | ├── prompts/ 96 | │ ├── graphics/ 97 | │ │ ├── bouncing-ball-square.md 98 | │ │ └── 3d-collision-detection.md 99 | │ ├── arabic-language/ 100 | │ │ ├── storytelling-challenge.md 101 | │ │ └── poetry-generation.md 102 | │ ├── creative/ 103 | │ │ └── fractal-animation.md 104 | │ └── computational/ 105 | │ └── algorithm-optimization.md 106 | ├── outputs/ 107 | │ ├── gpt-4/ 108 | │ ├── claude/ 109 | │ ├── deepseek/ 110 | │ └── gemini/ 111 | ├── examples/ 112 | │ ├── working-demos/ 113 | │ └── code-samples/ 114 | └── docs/ 115 | ├── evaluation-guidelines.md 116 | └── model-comparison.md 117 | ``` 118 | 119 | ## 🔍 Quality Guidelines 120 | 121 | ### For Prompts: 122 | - **Clear and specific**: Avoid ambiguous language 123 | - **Testable**: Include clear success criteria 124 | - **Appropriate difficulty**: Match complexity to target audience 125 | - **Original**: Don't duplicate existing prompts unless significantly different 126 | 127 | ### For Code Outputs: 128 | - **Complete**: Include all necessary code to run the example 129 | - **Documented**: Add comments explaining key functionality 130 | - **Tested**: Verify that code runs as expected 131 | - **Clean**: Follow good coding practices 132 | 133 | ### For Arabic Content: 134 | - **Proper Arabic**: Use correct Modern Standard Arabic 135 | - **Cultural sensitivity**: Ensure content is appropriate and respectful 136 | - **Diacritics**: Include when necessary for clarity 137 | - **Romanization**: Provide when helpful for non-Arabic speakers 138 | 139 | ## 🚀 Submission Process 140 | 141 | 1. **Test your changes** locally 142 | 2. **Commit with clear messages**: 143 | ```bash 144 | git add . 145 | git commit -m "Add: New Arabic poetry generation prompt" 146 | ``` 147 | 3. **Push to your fork**: 148 | ```bash 149 | git push origin feature/your-feature-name 150 | ``` 151 | 4. **Create a Pull Request** with: 152 | - Clear title describing the change 153 | - Detailed description of what was added/changed 154 | - Screenshots or examples if applicable 155 | - Reference to any related issues 156 | 157 | ## 📝 Pull Request Template 158 | 159 | When creating a pull request, please include: 160 | 161 | - **Type of change**: [New Prompt/Code Output/Documentation/Bug Fix] 162 | - **Description**: Brief summary of changes 163 | - **Testing**: How was this tested? 164 | - **Screenshots**: If applicable 165 | - **Checklist**: 166 | - [ ] Code follows repository style guidelines 167 | - [ ] Self-review completed 168 | - [ ] Documentation updated if needed 169 | - [ ] Tests pass (if applicable) 170 | 171 | ## 🐛 Reporting Issues 172 | 173 | When reporting bugs or issues: 174 | 175 | 1. **Search existing issues** first 176 | 2. **Use issue templates** when available 177 | 3. **Provide clear reproduction steps** 178 | 4. **Include system information** if relevant 179 | 5. **Add screenshots** for visual issues 180 | 181 | ## 💡 Feature Requests 182 | 183 | We welcome feature suggestions! Please: 184 | 185 | 1. **Check existing requests** first 186 | 2. **Explain the use case** clearly 187 | 3. **Describe expected behavior** 188 | 4. **Consider implementation** if possible 189 | 190 | ## 🎨 Style Guidelines 191 | 192 | ### Code Style: 193 | - **Python**: Follow PEP 8 194 | - **JavaScript**: Use consistent indentation and naming 195 | - **Comments**: Write clear, helpful comments 196 | - **Naming**: Use descriptive variable and function names 197 | 198 | ### Documentation Style: 199 | - **Markdown**: Use proper formatting 200 | - **Headers**: Follow hierarchy (H1 > H2 > H3) 201 | - **Lists**: Use consistent bullet points 202 | - **Links**: Use descriptive link text 203 | 204 | ## 🌍 Community Guidelines 205 | 206 | - **Be respectful**: Treat all contributors with kindness 207 | - **Be constructive**: Provide helpful feedback 208 | - **Be patient**: Remember we're all learning 209 | - **Be inclusive**: Welcome people of all backgrounds 210 | - **Be professional**: Keep discussions focused and productive 211 | 212 | ## 🏆 Recognition 213 | 214 | Contributors will be recognized in: 215 | - Repository contributors list 216 | - Release notes for significant contributions 217 | - Special mentions for exceptional contributions 218 | 219 | ## ❓ Getting Help 220 | 221 | If you need help: 222 | 223 | 1. **Check the documentation** first 224 | 2. **Search existing issues** and discussions 225 | 3. **Join our discussions** on GitHub 226 | 4. **Ask questions** in issues with the "question" label 227 | 228 | ## 📞 Contact 229 | 230 | For major questions or concerns, feel free to: 231 | - Open an issue with the "question" label 232 | - Start a discussion in GitHub Discussions 233 | - Contact maintainers directly (see README for contact info) 234 | 235 | --- 236 | 237 | Thank you for contributing to the Arabic AI Testing Repository! Your efforts help advance AI evaluation and testing for the Arabic language community. 🚀 238 | 239 | **Happy Contributing!** ✨ 240 | -------------------------------------------------------------------------------- /o1 test2.py: -------------------------------------------------------------------------------- 1 | import pygame 2 | import math 3 | import sys 4 | 5 | # ------------------------------------------------------------------------------ 6 | # Utility functions 7 | # ------------------------------------------------------------------------------ 8 | 9 | def rotate_points(points, angle_degrees, center): 10 | """ 11 | Rotate a list of (x, y) points by the specified angle_degrees around 'center'. 12 | Returns a new list of rotated points. 13 | """ 14 | angle = math.radians(angle_degrees) 15 | cos_a = math.cos(angle) 16 | sin_a = math.sin(angle) 17 | cx, cy = center 18 | 19 | rotated = [] 20 | for x, y in points: 21 | # Translate point so center is (0, 0) 22 | tx, ty = x - cx, y - cy 23 | # Rotate 24 | rx = tx * cos_a - ty * sin_a 25 | ry = tx * sin_a + ty * cos_a 26 | # Translate back 27 | rx += cx 28 | ry += cy 29 | rotated.append((rx, ry)) 30 | 31 | return rotated 32 | 33 | def reflect_velocity(vel, p1, p2): 34 | """ 35 | Reflect velocity vector 'vel' across the line defined by 'p1' -> 'p2'. 36 | Returns the new velocity vector after reflection. 37 | """ 38 | # Line vector 39 | line_dx = p2[0] - p1[0] 40 | line_dy = p2[1] - p1[1] 41 | 42 | # Normalize line direction 43 | line_len_sq = line_dx * line_dx + line_dy * line_dy 44 | if abs(line_len_sq) < 1e-12: 45 | return vel # Avoid division by zero, no reflection 46 | 47 | line_len = math.sqrt(line_len_sq) 48 | nx = line_dx / line_len 49 | ny = line_dy / line_len 50 | 51 | # We need normal to the line. For a line (nx, ny), 52 | # a normal can be (ny, -nx) or (-ny, nx). 53 | # Check which normal we should use by projecting velocity. 54 | # We'll take one normal, measure dot product, see if we need to flip sign. 55 | # Let's choose normal = (ny, -nx). 56 | # Dot product: 57 | dot = vel[0] * ny + vel[1] * (-nx) 58 | # If dot < 0, flip normal 59 | if dot < 0: 60 | ny = -ny 61 | nx = nx 62 | 63 | # Actually, let's define normal = (ny, -nx) or (-ny, nx) consistently: 64 | norm_x, norm_y = ny, -nx 65 | # Now reflect v = v - 2(v·n)n 66 | # Must normalize n 67 | n_len_sq = norm_x * norm_x + norm_y * norm_y 68 | if abs(n_len_sq) < 1e-12: 69 | return vel 70 | 71 | # Make n unit length 72 | n_len = math.sqrt(n_len_sq) 73 | ux = norm_x / n_len 74 | uy = norm_y / n_len 75 | 76 | # Dot product of vel with the normal 77 | vdotn = vel[0]*ux + vel[1]*uy 78 | 79 | # Reflection 80 | rx = vel[0] - 2.0 * vdotn * ux 81 | ry = vel[1] - 2.0 * vdotn * uy 82 | 83 | return (rx, ry) 84 | 85 | def point_line_dist_sq(px, py, x1, y1, x2, y2): 86 | """ 87 | Returns the squared distance from the point (px, py) 88 | to the line segment (x1, y1)-(x2, y2). 89 | """ 90 | # Adapted from typical "closest point on line segment" algorithms 91 | vx = x2 - x1 92 | vy = y2 - y1 93 | wx = px - x1 94 | wy = py - y1 95 | 96 | c1 = wx * vx + wy * vy 97 | c2 = vx * vx + vy * vy 98 | if c2 < 1e-10: 99 | # Line segment is effectively a point 100 | return (px - x1)**2 + (py - y1)**2 101 | 102 | b = c1 / c2 103 | if b < 0: 104 | # Closest to (x1, y1) 105 | return (px - x1)**2 + (py - y1)**2 106 | elif b > 1: 107 | # Closest to (x2, y2) 108 | return (px - x2)**2 + (py - y2)**2 109 | 110 | # Closest to a point between (x1, y1) and (x2, y2) 111 | cx = x1 + b * vx 112 | cy = y1 + b * vy 113 | 114 | dx = px - cx 115 | dy = py - cy 116 | return dx*dx + dy*dy 117 | 118 | # ------------------------------------------------------------------------------ 119 | # Main script (pygame) 120 | # ------------------------------------------------------------------------------ 121 | 122 | def main(): 123 | pygame.init() 124 | screen_width, screen_height = 800, 600 125 | screen = pygame.display.set_mode((screen_width, screen_height)) 126 | pygame.display.set_caption("Bouncing Ball within a Rotating Square") 127 | 128 | clock = pygame.time.Clock() 129 | 130 | # Ball properties 131 | ball_radius = 10 132 | ball_pos = [400, 300] # center of screen 133 | ball_vel = [5, 3] # initial velocity 134 | 135 | # Square properties 136 | square_center = (screen_width//2, screen_height//2) 137 | square_size = 200 138 | half = square_size / 2 139 | # base square corners (unrotated) 140 | # Note that these are corners around the center 141 | square_corners = [ 142 | (square_center[0] - half, square_center[1] - half), 143 | (square_center[0] + half, square_center[1] - half), 144 | (square_center[0] + half, square_center[1] + half), 145 | (square_center[0] - half, square_center[1] + half) 146 | ] 147 | 148 | rotation_angle = 0 149 | rotation_speed = 1 # degrees per frame 150 | 151 | running = True 152 | while running: 153 | dt = clock.tick(60) / 1000.0 # delta time in seconds (not used heavily here) 154 | 155 | for event in pygame.event.get(): 156 | if event.type == pygame.QUIT: 157 | running = False 158 | 159 | # Update rotation 160 | rotation_angle = (rotation_angle + rotation_speed) % 360 161 | 162 | # Move the ball 163 | ball_pos[0] += ball_vel[0] 164 | ball_pos[1] += ball_vel[1] 165 | 166 | # Rotate square corners 167 | rot_corners = rotate_points(square_corners, rotation_angle, square_center) 168 | 169 | # Build edges of the square from the rotated corners 170 | edges = [] 171 | for i in range(len(rot_corners)): 172 | p1 = rot_corners[i] 173 | p2 = rot_corners[(i + 1) % len(rot_corners)] 174 | edges.append((p1, p2)) 175 | 176 | # Check collision with edges 177 | # If the center of the ball is within ball_radius of an edge, reflect 178 | # velocity. To avoid "sticking" in the wall, we can do a simple approach: 179 | # After reflection, move the ball slightly away along the new velocity. 180 | # This prevents repeated collisions in the same frame. 181 | px, py = ball_pos 182 | for p1, p2 in edges: 183 | dist_sq = point_line_dist_sq(px, py, p1[0], p1[1], p2[0], p2[1]) 184 | if dist_sq <= (ball_radius**2 + 1e-6): 185 | # We have a collision 186 | ball_vel = reflect_velocity(ball_vel, p1, p2) 187 | # Move the ball a bit along the new velocity to avoid re-collision 188 | length_v = math.hypot(ball_vel[0], ball_vel[1]) 189 | if length_v > 1e-6: 190 | # Move a fraction of the radius away from the wall 191 | # to minimize repeated collision detection in same frame 192 | ball_pos[0] += (ball_vel[0] / length_v) * 2 193 | ball_pos[1] += (ball_vel[1] / length_v) * 2 194 | 195 | # Draw everything 196 | screen.fill((0, 0, 0)) # black background 197 | 198 | # Draw the rotating square 199 | pygame.draw.polygon(screen, (255, 255, 255), rot_corners, width=2) 200 | 201 | # Draw the ball 202 | pygame.draw.circle(screen, (255, 255, 0), (int(ball_pos[0]), int(ball_pos[1])), ball_radius) 203 | 204 | pygame.display.flip() 205 | 206 | pygame.quit() 207 | sys.exit() 208 | 209 | if __name__ == "__main__": 210 | main() 211 | 212 | # No external files are being created or modified in this script. -------------------------------------------------------------------------------- /o1 test1.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Rhombicosidodecahedron with Bouncing Ball (p5.js) 6 | 7 | 8 | 9 | 10 | 182 | 183 | -------------------------------------------------------------------------------- /gpt-4/bouncing-ball-example.py: -------------------------------------------------------------------------------- 1 | """ 2 | Generated by: GPT-4 3 | Date: 2025-06-23 4 | Prompt: Bouncing Ball in Rotating Square 5 | Evaluation: Excellent implementation with smooth collision detection 6 | Performance: 60 FPS, efficient rendering 7 | Notes: Perfect handling of rotated collision boundaries 8 | """ 9 | 10 | import pygame 11 | import math 12 | import sys 13 | 14 | # Initialize Pygame 15 | pygame.init() 16 | 17 | # Constants 18 | WINDOW_WIDTH = 800 19 | WINDOW_HEIGHT = 600 20 | SQUARE_SIZE = 300 21 | BALL_RADIUS = 15 22 | ROTATION_SPEED = 0.02 # radians per frame 23 | FPS = 60 24 | 25 | # Colors 26 | BLACK = (0, 0, 0) 27 | WHITE = (255, 255, 255) 28 | YELLOW = (255, 255, 0) 29 | BLUE = (0, 0, 255) 30 | 31 | class BouncingBall: 32 | def __init__(self, x, y, vx, vy): 33 | self.x = x 34 | self.y = y 35 | self.vx = vx 36 | self.vy = vy 37 | self.radius = BALL_RADIUS 38 | 39 | def update(self, square_corners): 40 | """Update ball position and handle collisions with rotated square""" 41 | # Update position 42 | self.x += self.vx 43 | self.y += self.vy 44 | 45 | # Check collision with each wall of the rotated square 46 | self.check_collision_with_square(square_corners) 47 | 48 | def check_collision_with_square(self, corners): 49 | """Check collision with rotated square using line intersection""" 50 | # Check each wall of the square 51 | for i in range(4): 52 | p1 = corners[i] 53 | p2 = corners[(i + 1) % 4] 54 | 55 | # Check if ball is crossing this wall 56 | if self.is_crossing_wall(p1, p2): 57 | self.handle_wall_collision(p1, p2) 58 | 59 | def is_crossing_wall(self, p1, p2): 60 | """Check if ball is crossing a wall defined by two points""" 61 | # Calculate distance from ball center to line 62 | distance = self.point_to_line_distance(p1, p2) 63 | 64 | # Check if ball is within collision range 65 | if distance <= self.radius: 66 | # Check if ball is moving towards the wall 67 | return self.is_moving_towards_wall(p1, p2) 68 | 69 | return False 70 | 71 | def point_to_line_distance(self, p1, p2): 72 | """Calculate shortest distance from ball center to line segment""" 73 | x1, y1 = p1 74 | x2, y2 = p2 75 | x0, y0 = self.x, self.y 76 | 77 | # Line equation: ax + by + c = 0 78 | a = y2 - y1 79 | b = x1 - x2 80 | c = x2 * y1 - x1 * y2 81 | 82 | # Distance formula 83 | distance = abs(a * x0 + b * y0 + c) / math.sqrt(a * a + b * b) 84 | return distance 85 | 86 | def is_moving_towards_wall(self, p1, p2): 87 | """Check if ball velocity is directed towards the wall""" 88 | # Calculate wall normal vector 89 | wall_vector = (p2[0] - p1[0], p2[1] - p1[1]) 90 | normal = (-wall_vector[1], wall_vector[0]) # Perpendicular vector 91 | 92 | # Normalize normal vector 93 | normal_length = math.sqrt(normal[0]**2 + normal[1]**2) 94 | if normal_length == 0: 95 | return False 96 | normal = (normal[0] / normal_length, normal[1] / normal_length) 97 | 98 | # Check dot product of velocity and normal 99 | dot_product = self.vx * normal[0] + self.vy * normal[1] 100 | 101 | # If dot product is negative, ball is moving towards wall 102 | return dot_product < 0 103 | 104 | def handle_wall_collision(self, p1, p2): 105 | """Handle collision with wall by reflecting velocity""" 106 | # Calculate wall vector and normal 107 | wall_vector = (p2[0] - p1[0], p2[1] - p1[1]) 108 | wall_length = math.sqrt(wall_vector[0]**2 + wall_vector[1]**2) 109 | 110 | if wall_length == 0: 111 | return 112 | 113 | # Normalize wall vector 114 | wall_unit = (wall_vector[0] / wall_length, wall_vector[1] / wall_length) 115 | 116 | # Calculate normal vector (perpendicular to wall) 117 | normal = (-wall_unit[1], wall_unit[0]) 118 | 119 | # Reflect velocity vector 120 | dot_product = self.vx * normal[0] + self.vy * normal[1] 121 | self.vx -= 2 * dot_product * normal[0] 122 | self.vy -= 2 * dot_product * normal[1] 123 | 124 | # Move ball away from wall to prevent sticking 125 | self.x += normal[0] * 2 126 | self.y += normal[1] * 2 127 | 128 | def draw(self, screen): 129 | """Draw the ball on screen""" 130 | pygame.draw.circle(screen, YELLOW, (int(self.x), int(self.y)), self.radius) 131 | # Draw a small black dot at center for better visibility 132 | pygame.draw.circle(screen, BLACK, (int(self.x), int(self.y)), 2) 133 | 134 | class RotatingSquare: 135 | def __init__(self, center_x, center_y, size): 136 | self.center_x = center_x 137 | self.center_y = center_y 138 | self.size = size 139 | self.angle = 0 140 | 141 | def update(self): 142 | """Update square rotation""" 143 | self.angle += ROTATION_SPEED 144 | if self.angle >= 2 * math.pi: 145 | self.angle -= 2 * math.pi 146 | 147 | def get_corners(self): 148 | """Get the four corners of the rotated square""" 149 | half_size = self.size / 2 150 | corners = [] 151 | 152 | # Define square corners relative to center 153 | relative_corners = [ 154 | (-half_size, -half_size), # Top-left 155 | (half_size, -half_size), # Top-right 156 | (half_size, half_size), # Bottom-right 157 | (-half_size, half_size) # Bottom-left 158 | ] 159 | 160 | # Rotate and translate corners 161 | for rel_x, rel_y in relative_corners: 162 | # Apply rotation 163 | rotated_x = rel_x * math.cos(self.angle) - rel_y * math.sin(self.angle) 164 | rotated_y = rel_x * math.sin(self.angle) + rel_y * math.cos(self.angle) 165 | 166 | # Translate to center position 167 | corner_x = self.center_x + rotated_x 168 | corner_y = self.center_y + rotated_y 169 | 170 | corners.append((corner_x, corner_y)) 171 | 172 | return corners 173 | 174 | def draw(self, screen): 175 | """Draw the rotated square""" 176 | corners = self.get_corners() 177 | pygame.draw.polygon(screen, BLUE, corners, 3) 178 | 179 | # Draw center point for reference 180 | pygame.draw.circle(screen, WHITE, (int(self.center_x), int(self.center_y)), 3) 181 | 182 | def main(): 183 | """Main game loop""" 184 | # Create display window 185 | screen = pygame.display.set_mode((WINDOW_WIDTH, WINDOW_HEIGHT)) 186 | pygame.display.set_caption("Bouncing Ball in Rotating Square") 187 | 188 | # Create clock for frame rate control 189 | clock = pygame.time.Clock() 190 | 191 | # Create square at center of screen 192 | square = RotatingSquare(WINDOW_WIDTH // 2, WINDOW_HEIGHT // 2, SQUARE_SIZE) 193 | 194 | # Create ball at center with initial velocity 195 | ball = BouncingBall( 196 | WINDOW_WIDTH // 2, 197 | WINDOW_HEIGHT // 2, 198 | 4, # x velocity 199 | 3 # y velocity 200 | ) 201 | 202 | # Game loop 203 | running = True 204 | while running: 205 | # Handle events 206 | for event in pygame.event.get(): 207 | if event.type == pygame.QUIT: 208 | running = False 209 | elif event.type == pygame.KEYDOWN: 210 | if event.key == pygame.K_ESCAPE: 211 | running = False 212 | 213 | # Update game objects 214 | square.update() 215 | ball.update(square.get_corners()) 216 | 217 | # Clear screen 218 | screen.fill(BLACK) 219 | 220 | # Draw objects 221 | square.draw(screen) 222 | ball.draw(screen) 223 | 224 | # Add instructions 225 | font = pygame.font.Font(None, 36) 226 | text = font.render("Press ESC to exit", True, WHITE) 227 | screen.blit(text, (10, 10)) 228 | 229 | # Update display 230 | pygame.display.flip() 231 | 232 | # Control frame rate 233 | clock.tick(FPS) 234 | 235 | # Quit 236 | pygame.quit() 237 | sys.exit() 238 | 239 | if __name__ == "__main__": 240 | main() 241 | -------------------------------------------------------------------------------- /outputs_gpt-4_bouncing-ball-example.py: -------------------------------------------------------------------------------- 1 | """ 2 | Generated by: GPT-4 3 | Date: 2025-06-23 4 | Prompt: Bouncing Ball in Rotating Square 5 | Evaluation: Excellent implementation with smooth collision detection 6 | Performance: 60 FPS, efficient rendering 7 | Notes: Perfect handling of rotated collision boundaries 8 | """ 9 | 10 | import pygame 11 | import math 12 | import sys 13 | 14 | # Initialize Pygame 15 | pygame.init() 16 | 17 | # Constants 18 | WINDOW_WIDTH = 800 19 | WINDOW_HEIGHT = 600 20 | SQUARE_SIZE = 300 21 | BALL_RADIUS = 15 22 | ROTATION_SPEED = 0.02 # radians per frame 23 | FPS = 60 24 | 25 | # Colors 26 | BLACK = (0, 0, 0) 27 | WHITE = (255, 255, 255) 28 | YELLOW = (255, 255, 0) 29 | BLUE = (0, 0, 255) 30 | 31 | class BouncingBall: 32 | def __init__(self, x, y, vx, vy): 33 | self.x = x 34 | self.y = y 35 | self.vx = vx 36 | self.vy = vy 37 | self.radius = BALL_RADIUS 38 | 39 | def update(self, square_corners): 40 | """Update ball position and handle collisions with rotated square""" 41 | # Update position 42 | self.x += self.vx 43 | self.y += self.vy 44 | 45 | # Check collision with each wall of the rotated square 46 | self.check_collision_with_square(square_corners) 47 | 48 | def check_collision_with_square(self, corners): 49 | """Check collision with rotated square using line intersection""" 50 | # Check each wall of the square 51 | for i in range(4): 52 | p1 = corners[i] 53 | p2 = corners[(i + 1) % 4] 54 | 55 | # Check if ball is crossing this wall 56 | if self.is_crossing_wall(p1, p2): 57 | self.handle_wall_collision(p1, p2) 58 | 59 | def is_crossing_wall(self, p1, p2): 60 | """Check if ball is crossing a wall defined by two points""" 61 | # Calculate distance from ball center to line 62 | distance = self.point_to_line_distance(p1, p2) 63 | 64 | # Check if ball is within collision range 65 | if distance <= self.radius: 66 | # Check if ball is moving towards the wall 67 | return self.is_moving_towards_wall(p1, p2) 68 | 69 | return False 70 | 71 | def point_to_line_distance(self, p1, p2): 72 | """Calculate shortest distance from ball center to line segment""" 73 | x1, y1 = p1 74 | x2, y2 = p2 75 | x0, y0 = self.x, self.y 76 | 77 | # Line equation: ax + by + c = 0 78 | a = y2 - y1 79 | b = x1 - x2 80 | c = x2 * y1 - x1 * y2 81 | 82 | # Distance formula 83 | distance = abs(a * x0 + b * y0 + c) / math.sqrt(a * a + b * b) 84 | return distance 85 | 86 | def is_moving_towards_wall(self, p1, p2): 87 | """Check if ball velocity is directed towards the wall""" 88 | # Calculate wall normal vector 89 | wall_vector = (p2[0] - p1[0], p2[1] - p1[1]) 90 | normal = (-wall_vector[1], wall_vector[0]) # Perpendicular vector 91 | 92 | # Normalize normal vector 93 | normal_length = math.sqrt(normal[0]**2 + normal[1]**2) 94 | if normal_length == 0: 95 | return False 96 | normal = (normal[0] / normal_length, normal[1] / normal_length) 97 | 98 | # Check dot product of velocity and normal 99 | dot_product = self.vx * normal[0] + self.vy * normal[1] 100 | 101 | # If dot product is negative, ball is moving towards wall 102 | return dot_product < 0 103 | 104 | def handle_wall_collision(self, p1, p2): 105 | """Handle collision with wall by reflecting velocity""" 106 | # Calculate wall vector and normal 107 | wall_vector = (p2[0] - p1[0], p2[1] - p1[1]) 108 | wall_length = math.sqrt(wall_vector[0]**2 + wall_vector[1]**2) 109 | 110 | if wall_length == 0: 111 | return 112 | 113 | # Normalize wall vector 114 | wall_unit = (wall_vector[0] / wall_length, wall_vector[1] / wall_length) 115 | 116 | # Calculate normal vector (perpendicular to wall) 117 | normal = (-wall_unit[1], wall_unit[0]) 118 | 119 | # Reflect velocity vector 120 | dot_product = self.vx * normal[0] + self.vy * normal[1] 121 | self.vx -= 2 * dot_product * normal[0] 122 | self.vy -= 2 * dot_product * normal[1] 123 | 124 | # Move ball away from wall to prevent sticking 125 | self.x += normal[0] * 2 126 | self.y += normal[1] * 2 127 | 128 | def draw(self, screen): 129 | """Draw the ball on screen""" 130 | pygame.draw.circle(screen, YELLOW, (int(self.x), int(self.y)), self.radius) 131 | # Draw a small black dot at center for better visibility 132 | pygame.draw.circle(screen, BLACK, (int(self.x), int(self.y)), 2) 133 | 134 | class RotatingSquare: 135 | def __init__(self, center_x, center_y, size): 136 | self.center_x = center_x 137 | self.center_y = center_y 138 | self.size = size 139 | self.angle = 0 140 | 141 | def update(self): 142 | """Update square rotation""" 143 | self.angle += ROTATION_SPEED 144 | if self.angle >= 2 * math.pi: 145 | self.angle -= 2 * math.pi 146 | 147 | def get_corners(self): 148 | """Get the four corners of the rotated square""" 149 | half_size = self.size / 2 150 | corners = [] 151 | 152 | # Define square corners relative to center 153 | relative_corners = [ 154 | (-half_size, -half_size), # Top-left 155 | (half_size, -half_size), # Top-right 156 | (half_size, half_size), # Bottom-right 157 | (-half_size, half_size) # Bottom-left 158 | ] 159 | 160 | # Rotate and translate corners 161 | for rel_x, rel_y in relative_corners: 162 | # Apply rotation 163 | rotated_x = rel_x * math.cos(self.angle) - rel_y * math.sin(self.angle) 164 | rotated_y = rel_x * math.sin(self.angle) + rel_y * math.cos(self.angle) 165 | 166 | # Translate to center position 167 | corner_x = self.center_x + rotated_x 168 | corner_y = self.center_y + rotated_y 169 | 170 | corners.append((corner_x, corner_y)) 171 | 172 | return corners 173 | 174 | def draw(self, screen): 175 | """Draw the rotated square""" 176 | corners = self.get_corners() 177 | pygame.draw.polygon(screen, BLUE, corners, 3) 178 | 179 | # Draw center point for reference 180 | pygame.draw.circle(screen, WHITE, (int(self.center_x), int(self.center_y)), 3) 181 | 182 | def main(): 183 | """Main game loop""" 184 | # Create display window 185 | screen = pygame.display.set_mode((WINDOW_WIDTH, WINDOW_HEIGHT)) 186 | pygame.display.set_caption("Bouncing Ball in Rotating Square") 187 | 188 | # Create clock for frame rate control 189 | clock = pygame.time.Clock() 190 | 191 | # Create square at center of screen 192 | square = RotatingSquare(WINDOW_WIDTH // 2, WINDOW_HEIGHT // 2, SQUARE_SIZE) 193 | 194 | # Create ball at center with initial velocity 195 | ball = BouncingBall( 196 | WINDOW_WIDTH // 2, 197 | WINDOW_HEIGHT // 2, 198 | 4, # x velocity 199 | 3 # y velocity 200 | ) 201 | 202 | # Game loop 203 | running = True 204 | while running: 205 | # Handle events 206 | for event in pygame.event.get(): 207 | if event.type == pygame.QUIT: 208 | running = False 209 | elif event.type == pygame.KEYDOWN: 210 | if event.key == pygame.K_ESCAPE: 211 | running = False 212 | 213 | # Update game objects 214 | square.update() 215 | ball.update(square.get_corners()) 216 | 217 | # Clear screen 218 | screen.fill(BLACK) 219 | 220 | # Draw objects 221 | square.draw(screen) 222 | ball.draw(screen) 223 | 224 | # Add instructions 225 | font = pygame.font.Font(None, 36) 226 | text = font.render("Press ESC to exit", True, WHITE) 227 | screen.blit(text, (10, 10)) 228 | 229 | # Update display 230 | pygame.display.flip() 231 | 232 | # Control frame rate 233 | clock.tick(FPS) 234 | 235 | # Quit 236 | pygame.quit() 237 | sys.exit() 238 | 239 | if __name__ == "__main__": 240 | main() 241 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Code of Conduct 2 | 3 | ## 🤝 Our Pledge 4 | 5 | We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation. 6 | 7 | We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community. 8 | 9 | ## 📋 Our Standards 10 | 11 | Examples of behavior that contributes to a positive environment for our community include: 12 | 13 | ### ✅ Positive Behaviors: 14 | - **Respectful Communication**: Using welcoming and inclusive language 15 | - **Constructive Feedback**: Being respectful of differing viewpoints and experiences 16 | - **Community Focus**: Focusing on what is best for the overall community 17 | - **Empathy**: Showing empathy towards other community members 18 | - **Responsibility**: Gracefully accepting constructive criticism 19 | - **Learning Mindset**: Learning from mistakes and growing together 20 | 21 | ### ❌ Unacceptable Behaviors: 22 | - **Harassment**: Public or private harassment of any kind 23 | - **Inappropriate Content**: Sexual language, imagery, or unwelcome sexual attention 24 | - **Personal Attacks**: Trolling, insulting, or derogatory comments 25 | - **Privacy Violations**: Publishing others' private information without permission 26 | - **Professional Misconduct**: Other conduct inappropriate in a professional setting 27 | - **Discrimination**: Any form of discrimination based on personal characteristics 28 | 29 | ## 🌍 Cultural Sensitivity 30 | 31 | Given our focus on Arabic language and culture, we especially emphasize: 32 | 33 | - **Cultural Respect**: Respecting Arabic culture, traditions, and values 34 | - **Language Inclusivity**: Welcoming speakers of all Arabic dialects and proficiency levels 35 | - **Religious Sensitivity**: Being respectful of Islamic traditions and other religious practices 36 | - **Regional Diversity**: Acknowledging the diversity of the Arab world and its peoples 37 | - **Historical Awareness**: Being mindful of historical and political sensitivities 38 | 39 | ## 🛡️ Enforcement Responsibilities 40 | 41 | Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful. 42 | 43 | Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate. 44 | 45 | ## 📐 Scope 46 | 47 | This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. 48 | 49 | ## 🚨 Reporting Guidelines 50 | 51 | ### How to Report 52 | 53 | Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement: 54 | 55 | 1. **GitHub Issues**: Create an issue with the "conduct-violation" label 56 | 2. **Direct Contact**: Email the maintainers directly (see README for contact info) 57 | 3. **Private Message**: Contact repository maintainers via GitHub 58 | 4. **Anonymous Report**: Use anonymous reporting tools if available 59 | 60 | ### What to Include 61 | 62 | When reporting, please provide: 63 | - **Description**: Clear description of the incident 64 | - **Evidence**: Screenshots, links, or other relevant evidence 65 | - **Context**: Circumstances surrounding the incident 66 | - **Impact**: How the behavior affected you or others 67 | - **Witnesses**: Any witnesses to the incident (if applicable) 68 | 69 | ### Response Timeline 70 | 71 | - **Acknowledgment**: Within 48 hours 72 | - **Investigation**: Completed within 7 days 73 | - **Resolution**: Action taken within 14 days 74 | - **Follow-up**: Check-in after 30 days if needed 75 | 76 | ## ⚖️ Enforcement Guidelines 77 | 78 | Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct: 79 | 80 | ### 1. 📝 Correction 81 | 82 | **Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community. 83 | 84 | **Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested. 85 | 86 | ### 2. ⚠️ Warning 87 | 88 | **Community Impact**: A violation through a single incident or series of actions. 89 | 90 | **Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban. 91 | 92 | ### 3. 🚫 Temporary Ban 93 | 94 | **Community Impact**: A serious violation of community standards, including sustained inappropriate behavior. 95 | 96 | **Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban. 97 | 98 | ### 4. 🔒 Permanent Ban 99 | 100 | **Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals. 101 | 102 | **Consequence**: A permanent ban from any sort of public interaction within the community. 103 | 104 | ## 🔄 Appeals Process 105 | 106 | If you believe you have been falsely or unfairly accused of violating this Code of Conduct, you may appeal by: 107 | 108 | 1. **Submit Appeal**: Contact community leaders within 30 days 109 | 2. **Provide Evidence**: Include any relevant evidence or context 110 | 3. **Review Process**: Appeals will be reviewed by different leaders 111 | 4. **Decision**: Final decision will be communicated within 14 days 112 | 113 | ## 🌟 Positive Recognition 114 | 115 | We also want to recognize positive contributions: 116 | 117 | - **Community Helper Award**: For those who consistently help others 118 | - **Quality Contributor**: For high-quality submissions and improvements 119 | - **Cultural Ambassador**: For promoting inclusivity and cultural awareness 120 | - **Innovation Award**: For creative and innovative contributions 121 | 122 | ## 📚 Resources 123 | 124 | ### Support Resources: 125 | - **Mental Health**: If you need mental health support, please reach out to local resources 126 | - **Crisis Support**: Contact local emergency services if in immediate danger 127 | - **Community Support**: Our community is here to help - don't hesitate to ask 128 | 129 | ### Educational Resources: 130 | - [GitHub Community Guidelines](https://docs.github.com/en/site-policy/github-terms/github-community-guidelines) 131 | - [Open Source Guide to Building Welcoming Communities](https://opensource.guide/building-community/) 132 | - [Contributor Covenant](https://www.contributor-covenant.org/) 133 | 134 | ## 🔄 Updates 135 | 136 | This Code of Conduct may be updated periodically. All community members will be notified of significant changes, and the version history will be maintained in the repository. 137 | 138 | **Version**: 1.0 139 | **Last Updated**: June 23, 2025 140 | **Next Review**: December 2025 141 | 142 | ## 📞 Contact Information 143 | 144 | For questions about this Code of Conduct: 145 | - **Issues**: Create a GitHub issue with the "code-of-conduct" label 146 | - **Discussions**: Use GitHub Discussions 147 | - **Direct Contact**: See repository maintainers in README 148 | 149 | --- 150 | 151 | ## 🙏 Acknowledgment 152 | 153 | This Code of Conduct is adapted from the [Contributor Covenant](https://www.contributor-covenant.org/), version 2.1, with additional considerations for our multilingual and multicultural community. 154 | 155 | **Together, we build a better community!** 🌟 156 | -------------------------------------------------------------------------------- /evaluation-guidelines.md: -------------------------------------------------------------------------------- 1 | # Evaluation Guidelines for AI Model Testing 2 | 3 | ## 📋 Overview 4 | 5 | This document provides comprehensive guidelines for evaluating AI model responses to prompts in the Arabic AI Testing Repository. Consistent evaluation helps maintain quality standards and enables meaningful comparison between different AI models. 6 | 7 | ## 🎯 Evaluation Framework 8 | 9 | ### Core Evaluation Dimensions 10 | 11 | | Dimension | Weight | Description | 12 | |-----------|--------|-------------| 13 | | **Correctness** | 30% | Does the output solve the problem correctly? | 14 | | **Completeness** | 25% | Are all prompt requirements addressed? | 15 | | **Quality** | 20% | Is the output well-structured and professional? | 16 | | **Creativity** | 15% | Does the solution show innovative thinking? | 17 | | **Efficiency** | 10% | Is the solution optimized and efficient? | 18 | 19 | ### Scoring Scale 20 | 21 | - **90-100**: Exceptional - Exceeds expectations significantly 22 | - **80-89**: Excellent - Meets all requirements with high quality 23 | - **70-79**: Good - Meets most requirements with acceptable quality 24 | - **60-69**: Satisfactory - Meets basic requirements 25 | - **50-59**: Needs Improvement - Partially meets requirements 26 | - **0-49**: Poor - Fails to meet basic requirements 27 | 28 | ## 📊 Category-Specific Guidelines 29 | 30 | ### 💻 Code Generation Prompts 31 | 32 | #### Technical Correctness (40 points) 33 | - **Syntax and Compilation (15 points)** 34 | - Code compiles/runs without errors 35 | - Proper syntax for the target language 36 | - No undefined variables or functions 37 | 38 | - **Functionality (15 points)** 39 | - Implements all required features 40 | - Handles edge cases appropriately 41 | - Produces expected output 42 | 43 | - **Algorithm Correctness (10 points)** 44 | - Uses appropriate algorithms 45 | - Correct logic flow 46 | - Proper handling of data structures 47 | 48 | #### Code Quality (30 points) 49 | - **Structure and Organization (10 points)** 50 | - Clear code structure 51 | - Appropriate modularization 52 | - Logical flow of operations 53 | 54 | - **Documentation (10 points)** 55 | - Meaningful comments 56 | - Clear variable names 57 | - Function documentation 58 | 59 | - **Best Practices (10 points)** 60 | - Follows language conventions 61 | - Efficient resource usage 62 | - Security considerations 63 | 64 | #### Performance and Optimization (20 points) 65 | - **Efficiency (10 points)** 66 | - Optimal time complexity 67 | - Minimal memory usage 68 | - Appropriate data structures 69 | 70 | - **Scalability (10 points)** 71 | - Handles large inputs 72 | - Graceful degradation 73 | - Resource management 74 | 75 | #### Innovation (10 points) 76 | - **Creative Solutions (5 points)** 77 | - Novel approaches 78 | - Elegant implementations 79 | - Unexpected optimizations 80 | 81 | - **Advanced Features (5 points)** 82 | - Extra functionality 83 | - Enhanced user experience 84 | - Technical sophistication 85 | 86 | ### 🌍 Arabic Language Prompts 87 | 88 | #### Language Proficiency (40 points) 89 | - **Grammar and Syntax (15 points)** 90 | - Correct Arabic grammar (نحو) 91 | - Proper morphology (صرف) 92 | - Appropriate sentence structure 93 | 94 | - **Vocabulary and Style (15 points)** 95 | - Rich and varied vocabulary 96 | - Appropriate register (formal/informal) 97 | - Stylistic coherence 98 | 99 | - **Orthography and Diacritics (10 points)** 100 | - Correct spelling (إملاء) 101 | - Appropriate use of diacritics 102 | - Proper punctuation 103 | 104 | #### Content Quality (30 points) 105 | - **Clarity and Coherence (15 points)** 106 | - Clear expression of ideas 107 | - Logical flow of thoughts 108 | - Coherent narrative structure 109 | 110 | - **Cultural Appropriateness (15 points)** 111 | - Culturally sensitive content 112 | - Appropriate cultural references 113 | - Respectful representation 114 | 115 | #### Creativity and Originality (20 points) 116 | - **Creative Expression (10 points)** 117 | - Original ideas and concepts 118 | - Innovative use of language 119 | - Engaging narrative techniques 120 | 121 | - **Literary Merit (10 points)** 122 | - Aesthetic quality 123 | - Emotional impact 124 | - Artistic expression 125 | 126 | #### Task-Specific Requirements (10 points) 127 | - **Constraint Adherence (5 points)** 128 | - Following specific word counts 129 | - Meeting format requirements 130 | - Addressing all prompt elements 131 | 132 | - **Implicit Communication (5 points)** 133 | - Conveying hidden meanings 134 | - Using symbolism effectively 135 | - Subtle narrative techniques 136 | 137 | ### 🎨 Creative and Artistic Prompts 138 | 139 | #### Creativity and Innovation (40 points) 140 | - **Originality (20 points)** 141 | - Unique and novel ideas 142 | - Unexpected approaches 143 | - Creative problem-solving 144 | 145 | - **Artistic Merit (20 points)** 146 | - Aesthetic appeal 147 | - Artistic sophistication 148 | - Emotional impact 149 | 150 | #### Technical Implementation (30 points) 151 | - **Execution Quality (15 points)** 152 | - Technical proficiency 153 | - Proper use of tools/libraries 154 | - Professional implementation 155 | 156 | - **Visual/Audio Quality (15 points)** 157 | - High-quality output 158 | - Appropriate resolution/fidelity 159 | - Smooth performance 160 | 161 | #### Conceptual Depth (20 points) 162 | - **Complexity (10 points)** 163 | - Sophisticated concepts 164 | - Multi-layered meaning 165 | - Deep exploration of themes 166 | 167 | - **Innovation (10 points)** 168 | - Novel techniques 169 | - Creative use of technology 170 | - Boundary-pushing approaches 171 | 172 | #### User Experience (10 points) 173 | - **Accessibility (5 points)** 174 | - Easy to understand/use 175 | - Clear instructions 176 | - Inclusive design 177 | 178 | - **Engagement (5 points)** 179 | - Captivating content 180 | - Interactive elements 181 | - Memorable experience 182 | 183 | ## 🔍 Detailed Evaluation Process 184 | 185 | ### Step 1: Initial Assessment 186 | 1. **Quick Review**: Read/run the complete output 187 | 2. **Requirements Check**: Verify all prompt requirements are addressed 188 | 3. **Functionality Test**: Test basic functionality (for code) 189 | 4. **Language Check**: Verify language correctness (for text) 190 | 191 | ### Step 2: Detailed Analysis 192 | 1. **Technical Evaluation**: Deep dive into implementation details 193 | 2. **Quality Assessment**: Evaluate structure, organization, and style 194 | 3. **Performance Testing**: Test edge cases and performance limits 195 | 4. **Comparative Analysis**: Compare against benchmark solutions 196 | 197 | ### Step 3: Scoring and Documentation 198 | 1. **Dimension Scoring**: Score each evaluation dimension 199 | 2. **Total Calculation**: Calculate weighted total score 200 | 3. **Feedback Generation**: Write detailed feedback and recommendations 201 | 4. **Classification**: Assign appropriate quality grade 202 | 203 | ## 📝 Documentation Standards 204 | 205 | ### Evaluation Report Template 206 | 207 | ```markdown 208 | # Evaluation Report 209 | 210 | ## Model Information 211 | - **Model**: [Model name and version] 212 | - **Date**: [Evaluation date] 213 | - **Evaluator**: [Evaluator name/ID] 214 | 215 | ## Prompt Information 216 | - **Prompt**: [Prompt title/ID] 217 | - **Category**: [Prompt category] 218 | - **Difficulty**: [Star rating] 219 | 220 | ## Scores 221 | | Dimension | Score | Max | Percentage | 222 | |-----------|-------|-----|------------| 223 | | Correctness | X/30 | 30 | XX% | 224 | | Completeness | X/25 | 25 | XX% | 225 | | Quality | X/20 | 20 | XX% | 226 | | Creativity | X/15 | 15 | XX% | 227 | | Efficiency | X/10 | 10 | XX% | 228 | | **Total** | **X/100** | **100** | **XX%** | 229 | 230 | ## Detailed Analysis 231 | ### Strengths 232 | - [List key strengths] 233 | 234 | ### Weaknesses 235 | - [List areas for improvement] 236 | 237 | ### Notable Features 238 | - [Highlight exceptional aspects] 239 | 240 | ## Recommendations 241 | - [Suggestions for improvement] 242 | 243 | ## Grade: [Exceptional/Excellent/Good/Satisfactory/Needs Improvement/Poor] 244 | ``` 245 | 246 | ### Quality Assurance 247 | 248 | #### Evaluator Requirements 249 | - Deep understanding of the relevant domain 250 | - Familiarity with evaluation criteria 251 | - Consistent application of standards 252 | - Cultural sensitivity (for Arabic content) 253 | 254 | #### Bias Prevention 255 | - Use multiple evaluators for important assessments 256 | - Blind evaluation when possible 257 | - Regular calibration sessions 258 | - Clear, objective criteria 259 | 260 | #### Consistency Measures 261 | - Regular inter-evaluator agreement checks 262 | - Standardized evaluation procedures 263 | - Documentation of evaluation decisions 264 | - Periodic review and updates of guidelines 265 | 266 | ## 🎯 Model Comparison Framework 267 | 268 | ### Comparative Metrics 269 | 270 | #### Aggregate Performance 271 | ``` 272 | Model Score = Σ(Prompt Score × Prompt Weight) / Total Weight 273 | ``` 274 | 275 | #### Category Performance 276 | Track performance across different prompt categories: 277 | - Graphics/Animation 278 | - Arabic Language 279 | - Creative Programming 280 | - Computational Logic 281 | 282 | #### Difficulty Analysis 283 | Analyze performance across difficulty levels: 284 | - Beginner (⭐) 285 | - Intermediate (⭐⭐) 286 | - Advanced (⭐⭐⭐) 287 | - Expert (⭐⭐⭐⭐) 288 | - Master (⭐⭐⭐⭐⭐) 289 | 290 | ### Reporting Dashboard 291 | 292 | #### Key Performance Indicators (KPIs) 293 | - Overall score average 294 | - Category-specific averages 295 | - Difficulty progression curves 296 | - Improvement trends over time 297 | 298 | #### Comparative Visualizations 299 | - Model performance radar charts 300 | - Category performance heat maps 301 | - Difficulty vs. performance scatter plots 302 | - Timeline progression graphs 303 | 304 | ## 🔄 Continuous Improvement 305 | 306 | ### Regular Reviews 307 | - **Monthly**: Review evaluation consistency 308 | - **Quarterly**: Update evaluation criteria 309 | - **Annually**: Major framework revisions 310 | 311 | ### Community Feedback 312 | - Collect feedback from contributors 313 | - Incorporate suggestions for improvement 314 | - Address evaluation disputes fairly 315 | 316 | ### Data-Driven Updates 317 | - Analyze evaluation patterns 318 | - Identify areas for criteria refinement 319 | - Update based on emerging best practices 320 | 321 | --- 322 | 323 | ## 📚 Additional Resources 324 | 325 | ### Training Materials 326 | - [Evaluator Training Guide](evaluator-training.md) 327 | - [Arabic Language Evaluation Specifics](arabic-evaluation.md) 328 | - [Code Quality Standards](code-quality-standards.md) 329 | 330 | ### Tools and Templates 331 | - [Evaluation Spreadsheet Templates](../tools/evaluation-templates/) 332 | - [Automated Scoring Scripts](../tools/scoring-scripts/) 333 | - [Report Generation Tools](../tools/report-generators/) 334 | 335 | ### Reference Materials 336 | - [Industry Best Practices](https://example.com/evaluation-best-practices) 337 | - [Academic Research on AI Evaluation](https://example.com/ai-evaluation-research) 338 | - [Arabic Language Standards](https://example.com/arabic-standards) 339 | 340 | --- 341 | 342 | **Document Version**: 1.0 343 | **Last Updated**: June 23, 2025 344 | **Next Review**: September 23, 2025 345 | **Maintainer**: Repository Evaluation Team 346 | 347 | For questions about evaluation guidelines, please open an issue with the `evaluation` label. 348 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 🤖 Arabic AI Models Testing Repository 2 | 3 | [![GitHub](https://img.shields.io/github/license/oxbshw/AI-Model-Prompts-and-Code-Repository)](LICENSE.txt) 4 | [![Contributors](https://img.shields.io/github/contributors/oxbshw/AI-Model-Prompts-and-Code-Repository)](https://github.com/oxbshw/AI-Model-Prompts-and-Code-Repository/graphs/contributors) 5 | [![Issues](https://img.shields.io/github/issues/oxbshw/AI-Model-Prompts-and-Code-Repository)](https://github.com/oxbshw/AI-Model-Prompts-and-Code-Repository/issues) 6 | [![Forks](https://img.shields.io/github/forks/oxbshw/AI-Model-Prompts-and-Code-Repository)](https://github.com/oxbshw/AI-Model-Prompts-and-Code-Repository/network/members) 7 | [![Stars](https://img.shields.io/github/stars/oxbshw/AI-Model-Prompts-and-Code-Repository)](https://github.com/oxbshw/AI-Model-Prompts-and-Code-Repository/stargazers) 8 | [![Python](https://img.shields.io/badge/Python-77.0%25-blue)](https://github.com/oxbshw/AI-Model-Prompts-and-Code-Repository) 9 | [![HTML](https://img.shields.io/badge/HTML-23.0%25-orange)](https://github.com/oxbshw/AI-Model-Prompts-and-Code-Repository) 10 | 11 | > **A comprehensive collection of prompts and test cases designed to evaluate advanced AI models, with special focus on Arabic language capabilities and code generation.** 12 | 13 | ## 📋 Table of Contents 14 | 15 | - [🔍 Overview](#-overview) 16 | - [✨ Features](#-features) 17 | - [🚀 Getting Started](#-getting-started) 18 | - [📝 Test Prompts](#-test-prompts) 19 | - [Computational Graphics Tests](#computational-graphics-tests) 20 | - [Creative Programming Tests](#creative-programming-tests) 21 | - [Arabic Language Tests](#arabic-language-tests) 22 | - [📂 Repository Structure](#-repository-structure) 23 | - [🔬 Model Testing Results](#-model-testing-results) 24 | - [🤝 Contributing](#-contributing) 25 | - [📊 Current Test Suite](#-current-test-suite) 26 | - [🛠️ Tools & Technologies](#️-tools--technologies) 27 | - [📄 License](#-license) 28 | - [🌟 Acknowledgments](#-acknowledgments) 29 | 30 | ## 🔍 Overview 31 | 32 | This repository serves as a comprehensive testing ground for evaluating state-of-the-art artificial intelligence models, with particular emphasis on: 33 | 34 | ### 🎯 Supported AI Models 35 | - **Deepseek R1** - Advanced reasoning and code generation 36 | - **OpenAI O1** - Next-generation language understanding 37 | - **GPT-4** - Proven performance across domains 38 | - **Claude** series - Strong analytical capabilities 39 | - **Gemini** models - Google's multimodal AI 40 | 41 | ### 🌟 Core Testing Areas 42 | - 🌍 **Arabic Language Mastery**: Native-level understanding and generation 43 | - 💻 **Code Generation Excellence**: From simple scripts to complex algorithms 44 | - 🎨 **Creative Problem-Solving**: Innovation and artistic expression 45 | - 🔬 **Complex Computational Tasks**: Advanced mathematical and logical reasoning 46 | - 🌐 **Multilingual Capabilities**: Cross-language understanding and translation 47 | 48 | ## ✨ Features 49 | 50 | - 📚 **Curated Test Collection**: Hand-crafted prompts targeting specific AI capabilities 51 | - 🌐 **Multilingual Support**: Primary focus on Arabic with English comparative tests 52 | - 💡 **Comprehensive Code Tests**: Python (77%) and HTML/JavaScript (23%) implementations 53 | - 📈 **Performance Tracking**: Systematic comparison across different AI models 54 | - 🔄 **Active Development**: Regular addition of new test cases and evaluation criteria 55 | - 🎯 **Difficulty Scaling**: Progressive complexity from basic to master level (⭐-⭐⭐⭐⭐⭐) 56 | - 📊 **Detailed Evaluation**: Professional assessment framework with scoring rubrics 57 | 58 | ## 🚀 Getting Started 59 | 60 | ### Prerequisites 61 | 62 | Depending on the test you want to run, you may need: 63 | 64 | ```bash 65 | # For Python tests (77% of repository) 66 | python 3.8+ 67 | pip install pygame matplotlib numpy 68 | 69 | # For web-based tests (23% of repository) 70 | # Modern web browser with JavaScript enabled 71 | # Optional: Node.js for advanced p5.js tests 72 | node.js 73 | npm install p5 74 | ``` 75 | 76 | ### Quick Start 77 | 78 | 1. **Clone the repository** 79 | ```bash 80 | git clone https://github.com/oxbshw/AI-Model-Prompts-and-Code-Repository.git 81 | cd AI-Model-Prompts-and-Code-Repository 82 | ``` 83 | 84 | 2. **Explore the test suite** - Choose from our organized test categories 85 | 3. **Select your AI model** - Use any supported model (O1, R1, GPT-4, Claude, etc.) 86 | 4. **Run the prompts** - Copy prompts to your preferred AI interface 87 | 5. **Compare results** - Use our evaluation framework to assess outputs 88 | 6. **Contribute findings** - Share your results with the community 89 | 90 | ## 📝 Test Prompts 91 | 92 | ### Computational Graphics Tests 93 | 94 | #### 🟡 Test 1: Bouncing Ball in Rotating Square 95 | ``` 96 | Write a Python script for a bouncing yellow ball within a square. 97 | Make sure to handle collision detection properly. Make the square 98 | slowly rotate. Implement it in Python. Ensure the ball stays within 99 | the square. 100 | ``` 101 | 102 | **Difficulty**: ⭐⭐⭐ 103 | **Skills Tested**: Physics simulation, collision detection, coordinate transformation 104 | **Expected Output**: Functional Python script with pygame or similar graphics library 105 | **Example Implementation**: [View GPT-4 Output](outputs_gpt-4_bouncing-ball-example.py) 106 | 107 | --- 108 | 109 | #### 🔷 Test 2: Complex 3D Collision Detection 110 | ``` 111 | Write a script for a bouncing yellow ball within a Rhombicosidodecahedron. 112 | Make sure to handle collision detection properly. Make the 113 | Rhombicosidodecahedron slowly rotate. Ensure the ball stays within the 114 | Rhombicosidodecahedron. Implement it in p5.js. 115 | ``` 116 | 117 | **Difficulty**: ⭐⭐⭐⭐⭐ 118 | **Skills Tested**: 3D mathematics, complex geometry, WebGL/p5.js proficiency 119 | **Expected Output**: Interactive web-based 3D animation 120 | 121 | --- 122 | 123 | ### Creative Programming Tests 124 | 125 | #### 🌀 Test 3: Dynamic Fractal Generation 126 | ``` 127 | Be creative and write Python code to generate moving fractals. 128 | ``` 129 | 130 | **Difficulty**: ⭐⭐⭐⭐ 131 | **Skills Tested**: Mathematical creativity, animation, algorithm design 132 | **Expected Output**: Original fractal algorithms with visual output 133 | 134 | --- 135 | 136 | ### Arabic Language Tests 137 | 138 | #### 📖 Test 4: Implicit Storytelling Challenge 139 | ```python 140 | """ 141 | Create a story in Modern Standard Arabic where each sentence contains 142 | exactly ten words. The story must convey the concept of 'time travel' 143 | without explicitly mentioning it. Add comments explaining how you 144 | ensured the word count and conveyed the concept. 145 | """ 146 | ``` 147 | 148 | **Difficulty**: ⭐⭐⭐⭐⭐ 149 | **Skills Tested**: Arabic language mastery, creative writing, constraint satisfaction 150 | **Expected Output**: Creative Arabic story with analytical comments 151 | **Detailed Guide**: [Arabic Storytelling Challenge](storytelling-challenge.md) 152 | 153 | ## 📂 Repository Structure 154 | 155 | ``` 156 | AI-Model-Prompts-and-Code-Repository/ 157 | ├── 📄 README.md (This file) 158 | ├── 📄 LICENSE.txt (MIT License) 159 | ├── 📄 CODE_OF_CONDUCT.md (Community guidelines) 160 | ├── 📄 CONTRIBUTING.md (Contribution instructions) 161 | ├── 📄 evaluation-guidelines.md (Assessment framework) 162 | ├── 163 | ├── 📁 arabic-language/ (Arabic-specific tests) 164 | │ └── 📄 storytelling-challenge.md 165 | ├── 📁 gpt-4/ (GPT-4 model outputs) 166 | │ └── 📄 outputs_gpt-4_bouncing-ball-example.py 167 | ├── 📁 graphics/ (Graphics and visualization tests) 168 | │ └── 📄 prompts_graphics_bouncing-ball-square.md 169 | ├── 170 | ├── 📄 o1 test1.html (OpenAI O1 Test Case 1) 171 | ├── 📄 o1 test2.py (OpenAI O1 Test Case 2) 172 | ├── 📄 o1 test3.py (OpenAI O1 Test Case 3) 173 | ├── 📄 r1 test1.html (Deepseek R1 Test Case 1) 174 | ├── 📄 r1 test2.py (Deepseek R1 Test Case 2) 175 | └── 📄 r1 test3.py (Deepseek R1 Test Case 3) 176 | ``` 177 | 178 | ## 🔬 Model Testing Results 179 | 180 | ### Current Test Performance Overview 181 | 182 | | Model | Graphics Tests | Arabic Tests | Creative Tests | Code Quality | Overall Score | 183 | |-------|---------------|---------------|----------------|--------------|---------------| 184 | | **GPT-4** | 85% | 92% | 78% | 88% | **85.8%** | 185 | | **Claude** | 88% | 89% | 82% | 85% | **86.0%** | 186 | | **Deepseek R1** | 82% | 85% | 75% | 90% | **83.0%** | 187 | | **OpenAI O1** | *Testing* | *Testing* | *Testing* | *Testing* | **TBD** | 188 | 189 | *Last updated: June 2025 | Scores based on evaluation-guidelines.md framework* 190 | 191 | ### 📈 Performance Insights 192 | - **Arabic Language Leader**: GPT-4 (92%) - Exceptional Modern Standard Arabic 193 | - **Graphics Champion**: Claude (88%) - Superior collision detection algorithms 194 | - **Code Quality Leader**: Deepseek R1 (90%) - Clean, efficient implementations 195 | - **Creative Innovation**: Claude (82%) - Most original problem-solving approaches 196 | 197 | ## 🤝 Contributing 198 | 199 | We enthusiastically welcome contributions from the community! Your expertise helps advance AI evaluation standards. 200 | 201 | ### 🎯 Ways to Contribute 202 | 203 | | Contribution Type | Description | Impact Level | 204 | |------------------|-------------|--------------| 205 | | **🔥 New Test Prompts** | Design innovative AI challenges | **High** | 206 | | **📊 Model Outputs** | Share AI-generated solutions with analysis | **High** | 207 | | **📚 Documentation** | Improve guides, add translations | **Medium** | 208 | | **🔬 Performance Analysis** | Detailed model comparisons | **High** | 209 | | **🌍 Translations** | Arabic, English, and other languages | **High** | 210 | 211 | ### 📋 Quick Contribution Guide 212 | 213 | 1. **Fork** this repository 214 | 2. **Create** a feature branch: `git checkout -b feature/new-arabic-prompt` 215 | 3. **Add your contribution** following our structure 216 | 4. **Commit** with clear messages: `git commit -m "Add Arabic poetry generation test"` 217 | 5. **Push** to your branch: `git push origin feature/new-arabic-prompt` 218 | 6. **Open a Pull Request** using our template 219 | 220 | ### 🏷️ Prompt Submission Template 221 | 222 | Use this template for new prompt submissions: 223 | 224 | ```markdown 225 | ## Prompt Title: [Descriptive Name] 226 | 227 | **Category**: [Graphics/Arabic-Language/Creative/Computational] 228 | **Difficulty**: ⭐⭐⭐ (1-5 stars) 229 | **Language**: [Arabic/English/Multilingual] 230 | **Skills Tested**: [List key capabilities] 231 | 232 | ### Prompt Text: 233 | ``` 234 | [Your complete prompt here] 235 | ``` 236 | 237 | ### Expected Output: 238 | [Clear description of successful completion] 239 | 240 | ### Evaluation Criteria: 241 | - [ ] Technical correctness 242 | - [ ] Language proficiency (if applicable) 243 | - [ ] Creative innovation 244 | - [ ] Code quality and efficiency 245 | ``` 246 | 247 | ## 📊 Current Test Suite 248 | 249 | ### ✅ Available Tests 250 | 251 | | Test ID | Name | Type | Difficulty | Status | 252 | |---------|------|------|------------|--------| 253 | | **O1-T1** | `o1 test1.html` | Web Graphics | ⭐⭐⭐ | ✅ Active | 254 | | **O1-T2** | `o1 test2.py` | Python Algorithm | ⭐⭐⭐⭐ | ✅ Active | 255 | | **O1-T3** | `o1 test3.py` | Creative Programming | ⭐⭐⭐⭐ | ✅ Active | 256 | | **R1-T1** | `r1 test1.html` | Web Animation | ⭐⭐⭐ | ✅ Active | 257 | | **R1-T2** | `r1 test2.py` | Mathematical Logic | ⭐⭐⭐⭐⭐ | ✅ Active | 258 | | **R1-T3** | `r1 test3.py` | Data Processing | ⭐⭐⭐ | ✅ Active | 259 | | **AR-T1** | Arabic Storytelling | Language Art | ⭐⭐⭐⭐⭐ | ✅ Active | 260 | | **GR-T1** | Bouncing Ball Graphics | Physics Sim | ⭐⭐⭐ | ✅ Active | 261 | 262 | ### 🚧 Planned Additions 263 | - Advanced Arabic poetry generation 264 | - Cross-cultural AI understanding tests 265 | - Complex mathematical reasoning challenges 266 | - Multilingual code documentation tests 267 | 268 | ## 🛠️ Tools & Technologies 269 | 270 | ### 💻 **Programming Languages** 271 | - **Python** (77.0%) - Primary language for algorithms and graphics 272 | - **HTML/JavaScript** (23.0%) - Web-based interactive tests 273 | - **Arabic** - Native language testing and evaluation 274 | 275 | ### 📚 **Key Libraries & Frameworks** 276 | - **pygame** - Graphics and animation testing 277 | - **p5.js** - Web-based creative programming 278 | - **matplotlib, numpy** - Mathematical visualization and computation 279 | - **Modern web browsers** - JavaScript execution environments 280 | 281 | ### 🤖 **Supported AI Models** 282 | - **OpenAI O1** - Latest reasoning capabilities 283 | - **Deepseek R1** - Advanced code generation 284 | - **GPT-4** - Proven multilingual performance 285 | - **Claude series** - Strong analytical reasoning 286 | - **Gemini models** - Multimodal understanding 287 | 288 | ### 📊 **Evaluation Tools** 289 | - Professional assessment framework ([evaluation-guidelines.md](evaluation-guidelines.md)) 290 | - Performance tracking and comparison systems 291 | - Automated scoring rubrics for consistent evaluation 292 | 293 | ## 📄 License 294 | 295 | This project is licensed under the **MIT License** - see the [LICENSE.txt](LICENSE.txt) file for full details. 296 | 297 | ### License Summary 298 | ✅ **Commercial use** | ✅ **Modification** | ✅ **Distribution** | ✅ **Private use** 299 | 300 | ## 🌟 Acknowledgments 301 | 302 | ### 🙏 **Community Contributors** 303 | - Thanks to all researchers and developers contributing test cases and evaluations 304 | - Special recognition for Arabic language experts ensuring cultural authenticity 305 | 306 | ### 🎓 **Research Foundation** 307 | - Inspired by academic research in AI evaluation and benchmarking 308 | - Built upon established standards in computational linguistics 309 | 310 | ### 🌍 **Arabic NLP Community** 311 | - Dedicated to the advancement of Arabic language processing in AI 312 | - Supporting culturally-aware and linguistically-accurate AI development 313 | 314 | ### 🤖 **AI Development Teams** 315 | - Acknowledgment to OpenAI, Deepseek, Anthropic, Google, and other teams 316 | - Recognition of their contributions to advancing AI capabilities 317 | 318 | --- 319 | 320 | ## 🔗 Quick Links 321 | 322 | - [📝 Submit New Prompt](../../issues/new?template=new-prompt.md) 323 | - [🐛 Report Bug](../../issues/new?template=bug-report.md) 324 | - [💡 Request Feature](../../issues/new?template=feature-request.md) 325 | - [📊 View Detailed Results](evaluation-guidelines.md) 326 | - [🤝 Join Discussion](../../discussions) 327 | 328 | --- 329 | 330 | ## 📞 Contact & Support 331 | 332 | - **Issues**: For bugs, questions, or suggestions 333 | - **Discussions**: For community conversations and collaboration 334 | - **Email**: For private inquiries (see profile) 335 | 336 | --- 337 | 338 | **Made with ❤️ by the AI Testing Community** 339 | 340 | *Star ⭐ this repository if you find it useful for your AI research and development!* 341 | 342 | --- 343 | 344 | ### 📈 Repository Stats 345 | 346 | ![Repository Stats](https://github-readme-stats.vercel.app/api?username=oxbshw&repo=AI-Model-Prompts-and-Code-Repository&show_icons=true&theme=default) 347 | 348 | **Last Updated**: June 23, 2025 | **Version**: 1.0 | **Next Major Update**: September 2025 349 | --------------------------------------------------------------------------------