Files
hakorune/examples/text_adventure/test_simple_rooms.nyash
Moe Charm 0bed0c0271 🎉 initial commit: Nyash Programming Language完成版
🚀 主要機能:
• Everything is Box哲学による革新的アーキテクチャ
• WebAssemblyブラウザー対応プレイグラウンド
• アーティスト協同制作デモ - 複数Boxインスタンス実証
• 視覚的デバッグシステム - DebugBox完全統合
• static box Mainパターン - メモリ安全設計

 言語機能:
• NOT/AND/OR/除算演算子完全実装
• ジェネリクス/テンプレートシステム
• 非同期処理(nowait/await)
• try/catchエラーハンドリング
• Canvas統合グラフィックス

🎨 ブラウザー体験:
• 9種類のインタラクティブデモ
• リアルタイムコード実行
• WebCanvas/WebConsole/WebDisplay
• モバイル対応完了

🤖 Built with Claude Code collaboration
Ready for public release!
2025-08-09 15:14:44 +09:00

44 lines
1.2 KiB
Plaintext

// Test file for simple_rooms.nyash
include "text_adventure/simple_rooms.nyash"
print("🏰 Testing Simple Rooms Module...")
// Test 1: Basic room creation
print("\n=== Test 1: Basic Room ===")
testRoom = new Room("Test Room", "A simple test room for debugging.")
print("Room created: " + testRoom.name)
print(testRoom.look())
// Test 2: Adding items to room
print("\n=== Test 2: Room Items ===")
coin = new Item("Gold Coin", "A shiny coin", 1, 50)
testRoom.addItem(coin)
print("After adding coin:")
print(testRoom.look())
// Test 3: Taking items from room
print("\n=== Test 3: Taking Items ===")
takenItem = testRoom.takeItem("Gold Coin")
if takenItem {
takenName = takenItem.name
print("Took: " + takenName)
} else {
print("Failed to take item")
}
print("Room after taking item:")
print(testRoom.look())
// Test 4: Has item check
print("\n=== Test 4: Item Existence ===")
sword = createSword()
testRoom.addItem(sword)
print("Has Iron Sword: " + testRoom.hasItem("Iron Sword"))
print("Has Gold Coin: " + testRoom.hasItem("Gold Coin"))
// Test 5: World creation
print("\n=== Test 5: Simple World ===")
startRoom = createSimpleWorld()
print("World created! Starting room:")
print(startRoom.look())
print("\n✅ Simple Rooms module test completed!")