| {"id": "comp-w01", "track": "compile", "type": "compile", "difficulty": "easy", "subtype": "write", "question": "Write a Unity MonoBehaviour named Spinner that, in Update, rotates its transform around the Y axis at 90 degrees per second (frame-rate independent). Return ONLY one C# code block."} | |
| {"id": "comp-w02", "track": "compile", "type": "compile", "difficulty": "easy", "subtype": "write", "question": "Write a Unity MonoBehaviour named Health with a serialized int field maxHealth and a method TakeDamage(int amount) that reduces a current value and logs it with Debug.Log. Return ONLY one C# code block."} | |
| {"id": "comp-w03", "track": "compile", "type": "compile", "difficulty": "medium", "subtype": "write", "question": "Write a Unity MonoBehaviour named Mover that caches its Rigidbody in Awake and, in FixedUpdate, moves it forward at 5 units/sec using the CURRENT Unity 6 velocity API (no deprecated members). Return ONLY one C# code block.", "warns_as_errors": ["CS0618"]} | |
| {"id": "comp-w04", "track": "compile", "type": "compile", "difficulty": "medium", "subtype": "write", "question": "Write a Unity MonoBehaviour with a coroutine that waits 2 seconds and then logs \"done\" with Debug.Log, started from Start(). Return ONLY one C# code block."} | |
| {"id": "comp-w05", "track": "compile", "type": "compile", "difficulty": "medium", "subtype": "write", "question": "Define a C# interface IDamageable with a method void TakeDamage(int amount), and a Unity MonoBehaviour named Enemy that implements it. Return ONLY one C# code block."} | |
| {"id": "comp-w06", "track": "compile", "type": "compile", "difficulty": "medium", "subtype": "write", "question": "Write an abstract Unity MonoBehaviour base class Weapon with an abstract method void Fire(), and a concrete subclass Pistol that overrides Fire() to log a message. Return ONLY one C# code block."} | |
| {"id": "comp-w07", "track": "compile", "type": "compile", "difficulty": "trap", "subtype": "write", "question": "Write a generic class ObjectPool<T> where T : UnityEngine.Component, with methods T Get() and void Return(T item) backed by a Stack<T>. Return ONLY one C# code block."} | |
| {"id": "comp-w08", "track": "compile", "type": "compile", "difficulty": "trap", "subtype": "write", "question": "Write a Unity MonoBehaviour that retrieves every Enemy component in the scene using the CURRENT Unity 6 API (FindObjectsOfType is deprecated/removed) and logs how many were found. Assume an Enemy MonoBehaviour exists. Return ONLY one C# code block, and include a minimal Enemy class so it compiles."} | |
| {"id": "comp-f01", "track": "compile", "type": "compile", "difficulty": "easy", "subtype": "fix", "question": "This Unity script fails to compile. Return the corrected FULL script in ONE C# code block, no explanation:\n```csharp\nusing UnityEngine;\npublic class Counter : MonoBehaviour {\n int n = 0;\n void Update() {\n n = n + 1\n Debug.Log(n);\n }\n}\n```"} | |
| {"id": "comp-f02", "track": "compile", "type": "compile", "difficulty": "easy", "subtype": "fix", "question": "This Unity script fails to compile (a brace is missing). Return the corrected FULL script in ONE C# code block, no explanation:\n```csharp\nusing UnityEngine;\npublic class Greeter : MonoBehaviour {\n void Start() {\n Debug.Log(\"hi\");\n}\n```"} | |
| {"id": "comp-f03", "track": "compile", "type": "compile", "difficulty": "medium", "subtype": "fix", "question": "This Unity script fails to compile (a type error). Return the corrected FULL script in ONE C# code block, no explanation:\n```csharp\nusing UnityEngine;\npublic class Score : MonoBehaviour {\n int points = \"0\";\n void Add() { points = points + 1; }\n}\n```"} | |
| {"id": "comp-f04", "track": "compile", "type": "compile", "difficulty": "medium", "subtype": "fix", "question": "This Unity script fails to compile (a method name is wrong). Return the corrected FULL script in ONE C# code block, no explanation:\n```csharp\nusing UnityEngine;\npublic class Logger : MonoBehaviour {\n void Start() { Debug.Print(\"hello\"); }\n}\n```"} | |
| {"id": "comp-f05", "track": "compile", "type": "compile", "difficulty": "trap", "subtype": "fix", "question": "This Unity script uses a deprecated API and must compile under Unity 6 with NO obsolete-member usage. Return the corrected FULL script in ONE C# code block, no explanation:\n```csharp\nusing UnityEngine;\npublic class Push : MonoBehaviour {\n Rigidbody rb;\n void Awake() { rb = GetComponent<Rigidbody>(); }\n void FixedUpdate() { rb.velocity = Vector3.forward * 5f; }\n}\n```", "warns_as_errors": ["CS0618"]} | |
| {"id": "comp-c01", "track": "compile", "type": "compile", "difficulty": "trap", "subtype": "currency", "question": "Write a Unity MonoBehaviour that sets a Rigidbody2D's velocity to (3, 0) using the CURRENT Unity 6 API (the velocity property was renamed). Cache the Rigidbody2D in Awake. Return ONLY one C# code block.", "warns_as_errors": ["CS0618"]} | |
| {"id": "comp-c02", "track": "compile", "type": "compile", "difficulty": "trap", "subtype": "currency", "question": "Write a Unity MonoBehaviour that, in Start, finds the single Camera-like component via Camera.main and logs whether it is null. Then in Update reads Time.deltaTime. It must compile cleanly under Unity 6. Return ONLY one C# code block."} | |
| {"id": "comp-w09", "track": "compile", "type": "compile", "difficulty": "medium", "subtype": "write", "question": "Write a Unity ScriptableObject named GameConfig with a [CreateAssetMenu] attribute and a public int startingLives field. Return ONLY one C# code block."} | |
| {"id": "comp-w10", "track": "compile", "type": "compile", "difficulty": "medium", "subtype": "write", "question": "Write a plain C# class EventBus with a public C# event Action<int> OnScored and a method Raise(int n) that invokes it null-safely. Return ONLY one C# code block."} | |
| {"id": "comp-w11", "track": "compile", "type": "compile", "difficulty": "trap", "subtype": "write", "question": "Write a generic Singleton<T> base class where T : UnityEngine.Component, exposing a static T Instance property backed by a static field. Return ONLY one C# code block."} | |
| {"id": "comp-w12", "track": "compile", "type": "compile", "difficulty": "medium", "subtype": "write", "question": "Write a Unity MonoBehaviour that uses LINQ to count how many ints in an int[] field are greater than 10, and logs the count. Return ONLY one C# code block."} | |
| {"id": "comp-w13", "track": "compile", "type": "compile", "difficulty": "easy", "subtype": "write", "question": "Write a Unity MonoBehaviour named Player with a private int backing field and a public Health property (get and set). Return ONLY one C# code block."} | |
| {"id": "comp-w14", "track": "compile", "type": "compile", "difficulty": "medium", "subtype": "write", "question": "Write a Unity MonoBehaviour with an enum State { Idle, Running, Dead } field and a method that returns a string via a switch over the state. Return ONLY one C# code block."} | |
| {"id": "comp-c03", "track": "compile", "type": "compile", "difficulty": "trap", "subtype": "currency", "question": "Write a Unity MonoBehaviour that sets a cached Rigidbody's linear damping to 2 using the CURRENT Unity 6 API (the drag property was renamed). Cache the Rigidbody in Awake. Return ONLY one C# code block.", "warns_as_errors": ["CS0618"]} | |
| {"id": "comp-c04", "track": "compile", "type": "compile", "difficulty": "trap", "subtype": "currency", "question": "Write a Unity MonoBehaviour that, in Start, gets the first Enemy in the scene using the CURRENT Unity 6 API (FindObjectOfType is deprecated) and logs whether it is null. Include a minimal Enemy MonoBehaviour. Return ONLY one C# code block."} | |
| {"id": "comp-f06", "track": "compile", "type": "compile", "difficulty": "medium", "subtype": "fix", "question": "This Unity script fails to compile because the abstract method is not implemented. Return the corrected FULL script in ONE C# code block, no explanation:\n```csharp\nusing UnityEngine;\npublic abstract class Shape : MonoBehaviour { public abstract float Area(); }\npublic class Circle : Shape { public float radius = 1f; }\n```"} | |
| {"id": "comp-f07", "track": "compile", "type": "compile", "difficulty": "medium", "subtype": "fix", "question": "This Unity script fails to compile (a member that does not exist is used). Return the corrected FULL script in ONE C# code block, no explanation:\n```csharp\nusing UnityEngine;\npublic class Teleport : MonoBehaviour {\n void Start() { transform.SetPosition(0f, 1f, 0f); }\n}\n```"} | |