Pascal J. Bourguignon [2014-04-03 04:39]
diff --git a/gnustep/GNUmakefile b/gnustep/GNUmakefile
index 7e2e058..936561f 100644
--- a/gnustep/GNUmakefile
+++ b/gnustep/GNUmakefile
@@ -16,7 +16,7 @@ include $(GNUSTEP_MAKEFILES)/common.make
VERSION = 1.0
PACKAGE_NAME = hangman
APP_NAME = hangman
-hangman_APPLICATION_ICON = icon.png
+hangman_APPLICATION_ICON = icon.jpeg
#
@@ -27,19 +27,19 @@ Resources/Main.gsmarkup \
Resources/MainMenu-GNUstep.gsmarkup \
Resources/MainMenu-OSX.gsmarkup \
Resources/hangman.gorm \
-Resources/hung-0.png \
-Resources/hung-1.png \
-Resources/hung-10.png \
-Resources/hung-11.png \
-Resources/hung-2.png \
-Resources/hung-3.png \
-Resources/hung-4.png \
-Resources/hung-5.png \
-Resources/hung-6.png \
-Resources/hung-7.png \
-Resources/hung-8.png \
-Resources/hung-9.png \
-Resources/icon.png
+Resources/hung-0.jpeg \
+Resources/hung-1.jpeg \
+Resources/hung-10.jpeg \
+Resources/hung-11.jpeg \
+Resources/hung-2.jpeg \
+Resources/hung-3.jpeg \
+Resources/hung-4.jpeg \
+Resources/hung-5.jpeg \
+Resources/hung-6.jpeg \
+Resources/hung-7.jpeg \
+Resources/hung-8.jpeg \
+Resources/hung-9.jpeg \
+Resources/icon.jpeg
#
diff --git a/gnustep/HangmanController+gorm.h b/gnustep/HangmanController+gorm.h
new file mode 100644
index 0000000..ada1d83
--- /dev/null
+++ b/gnustep/HangmanController+gorm.h
@@ -0,0 +1,56 @@
+// -*- mode:objc;coding:utf-8 -*-
+//****************************************************************************
+//FILE: HangmanController.h
+//LANGUAGE: Objective-C
+//SYSTEM: Linux
+//USER-INTERFACE: GNUstep
+//DESCRIPTION
+//
+// The hangman game controller.
+//
+//AUTHORS
+// <PJB> Pascal J. Bourguignon <pjb@informatimago.com>
+//MODIFICATIONS
+// 2014-04-03 <PJB> Created.
+//BUGS
+//LEGAL
+// AGPL3
+//
+// Copyright Pascal J. Bourguignon 2014 - 2014
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU Affero General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU Affero General Public License for more details.
+//
+// You should have received a copy of the GNU Affero General Public License
+// along with this program. If not, see <http://www.gnu.org/licenses/>.
+//****************************************************************************
+#ifndef HangmanController_h
+#define HangmanController_h
+#include "Hangman.h"
+#include <AppKit/AppKit.h>
+
+@interface HangmanController:NSView
+{
+ // outlets:
+ id image;
+ id letters;
+ id message;
+ id guessed;
+}
+
+// actions:
+
+-(void)selectLetter:(id)sender;
+-(void)newGame:(id)sender;
+
+
+@end
+#endif
+//// THE END ////
diff --git a/gnustep/Resources/hangman.gorm/data.classes b/gnustep/Resources/hangman.gorm/data.classes
index 609f469..9a76923 100644
--- a/gnustep/Resources/hangman.gorm/data.classes
+++ b/gnustep/Resources/hangman.gorm/data.classes
@@ -32,7 +32,7 @@
message,
guessed
);
- Super = NSObject;
+ Super = NSView;
};
WindW = {
Actions = (
diff --git a/gnustep/Resources/hangman.gorm/objects.gorm b/gnustep/Resources/hangman.gorm/objects.gorm
index c9aa3e0..eeda7f1 100644
Binary files a/gnustep/Resources/hangman.gorm/objects.gorm and b/gnustep/Resources/hangman.gorm/objects.gorm differ
diff --git a/gnustep/Resources/hung-0.jpeg b/gnustep/Resources/hung-0.jpeg
new file mode 100644
index 0000000..f50b96a
Binary files /dev/null and b/gnustep/Resources/hung-0.jpeg differ
diff --git a/gnustep/Resources/hung-0.png b/gnustep/Resources/hung-0.png
deleted file mode 120000
index 4804c15..0000000
--- a/gnustep/Resources/hung-0.png
+++ /dev/null
@@ -1 +0,0 @@
-../../images/hung-0.png
\ No newline at end of file
diff --git a/gnustep/Resources/hung-1.jpeg b/gnustep/Resources/hung-1.jpeg
new file mode 100644
index 0000000..ccf763b
Binary files /dev/null and b/gnustep/Resources/hung-1.jpeg differ
diff --git a/gnustep/Resources/hung-1.png b/gnustep/Resources/hung-1.png
deleted file mode 120000
index 089b4a4..0000000
--- a/gnustep/Resources/hung-1.png
+++ /dev/null
@@ -1 +0,0 @@
-../../images/hung-1.png
\ No newline at end of file
diff --git a/gnustep/Resources/hung-10.jpeg b/gnustep/Resources/hung-10.jpeg
new file mode 100644
index 0000000..cea7cb8
Binary files /dev/null and b/gnustep/Resources/hung-10.jpeg differ
diff --git a/gnustep/Resources/hung-10.png b/gnustep/Resources/hung-10.png
deleted file mode 120000
index 15ca402..0000000
--- a/gnustep/Resources/hung-10.png
+++ /dev/null
@@ -1 +0,0 @@
-../../images/hung-10.png
\ No newline at end of file
diff --git a/gnustep/Resources/hung-11.jpeg b/gnustep/Resources/hung-11.jpeg
new file mode 100644
index 0000000..1908bd1
Binary files /dev/null and b/gnustep/Resources/hung-11.jpeg differ
diff --git a/gnustep/Resources/hung-11.png b/gnustep/Resources/hung-11.png
deleted file mode 120000
index f0047c0..0000000
--- a/gnustep/Resources/hung-11.png
+++ /dev/null
@@ -1 +0,0 @@
-../../images/hung-11.png
\ No newline at end of file
diff --git a/gnustep/Resources/hung-2.jpeg b/gnustep/Resources/hung-2.jpeg
new file mode 100644
index 0000000..0f8d349
Binary files /dev/null and b/gnustep/Resources/hung-2.jpeg differ
diff --git a/gnustep/Resources/hung-2.png b/gnustep/Resources/hung-2.png
deleted file mode 120000
index 0b6580a..0000000
--- a/gnustep/Resources/hung-2.png
+++ /dev/null
@@ -1 +0,0 @@
-../../images/hung-2.png
\ No newline at end of file
diff --git a/gnustep/Resources/hung-3.jpeg b/gnustep/Resources/hung-3.jpeg
new file mode 100644
index 0000000..2f8812f
Binary files /dev/null and b/gnustep/Resources/hung-3.jpeg differ
diff --git a/gnustep/Resources/hung-3.png b/gnustep/Resources/hung-3.png
deleted file mode 120000
index 8fecf08..0000000
--- a/gnustep/Resources/hung-3.png
+++ /dev/null
@@ -1 +0,0 @@
-../../images/hung-3.png
\ No newline at end of file
diff --git a/gnustep/Resources/hung-4.jpeg b/gnustep/Resources/hung-4.jpeg
new file mode 100644
index 0000000..5ae357f
Binary files /dev/null and b/gnustep/Resources/hung-4.jpeg differ
diff --git a/gnustep/Resources/hung-4.png b/gnustep/Resources/hung-4.png
deleted file mode 120000
index a8daad7..0000000
--- a/gnustep/Resources/hung-4.png
+++ /dev/null
@@ -1 +0,0 @@
-../../images/hung-4.png
\ No newline at end of file
diff --git a/gnustep/Resources/hung-5.jpeg b/gnustep/Resources/hung-5.jpeg
new file mode 100644
index 0000000..97c219a
Binary files /dev/null and b/gnustep/Resources/hung-5.jpeg differ
diff --git a/gnustep/Resources/hung-5.png b/gnustep/Resources/hung-5.png
deleted file mode 120000
index 71453a5..0000000
--- a/gnustep/Resources/hung-5.png
+++ /dev/null
@@ -1 +0,0 @@
-../../images/hung-5.png
\ No newline at end of file
diff --git a/gnustep/Resources/hung-6.jpeg b/gnustep/Resources/hung-6.jpeg
new file mode 100644
index 0000000..b2a5860
Binary files /dev/null and b/gnustep/Resources/hung-6.jpeg differ
diff --git a/gnustep/Resources/hung-6.png b/gnustep/Resources/hung-6.png
deleted file mode 120000
index 37e06e3..0000000
--- a/gnustep/Resources/hung-6.png
+++ /dev/null
@@ -1 +0,0 @@
-../../images/hung-6.png
\ No newline at end of file
diff --git a/gnustep/Resources/hung-7.jpeg b/gnustep/Resources/hung-7.jpeg
new file mode 100644
index 0000000..44e9d99
Binary files /dev/null and b/gnustep/Resources/hung-7.jpeg differ
diff --git a/gnustep/Resources/hung-7.png b/gnustep/Resources/hung-7.png
deleted file mode 120000
index 9ff284c..0000000
--- a/gnustep/Resources/hung-7.png
+++ /dev/null
@@ -1 +0,0 @@
-../../images/hung-7.png
\ No newline at end of file
diff --git a/gnustep/Resources/hung-8.jpeg b/gnustep/Resources/hung-8.jpeg
new file mode 100644
index 0000000..fb605d9
Binary files /dev/null and b/gnustep/Resources/hung-8.jpeg differ
diff --git a/gnustep/Resources/hung-8.png b/gnustep/Resources/hung-8.png
deleted file mode 120000
index 250b31b..0000000
--- a/gnustep/Resources/hung-8.png
+++ /dev/null
@@ -1 +0,0 @@
-../../images/hung-8.png
\ No newline at end of file
diff --git a/gnustep/Resources/hung-9.jpeg b/gnustep/Resources/hung-9.jpeg
new file mode 100644
index 0000000..2e10912
Binary files /dev/null and b/gnustep/Resources/hung-9.jpeg differ
diff --git a/gnustep/Resources/hung-9.png b/gnustep/Resources/hung-9.png
deleted file mode 120000
index 269c136..0000000
--- a/gnustep/Resources/hung-9.png
+++ /dev/null
@@ -1 +0,0 @@
-../../images/hung-9.png
\ No newline at end of file
diff --git a/gnustep/Resources/icon.jpeg b/gnustep/Resources/icon.jpeg
new file mode 100644
index 0000000..a80fc48
Binary files /dev/null and b/gnustep/Resources/icon.jpeg differ
diff --git a/gnustep/Resources/icon.png b/gnustep/Resources/icon.png
deleted file mode 120000
index 0babf05..0000000
--- a/gnustep/Resources/icon.png
+++ /dev/null
@@ -1 +0,0 @@
-../../images/icon.png
\ No newline at end of file
diff --git a/gnustep/hangman.app/Resources/Info-gnustep.plist b/gnustep/hangman.app/Resources/Info-gnustep.plist
deleted file mode 100644
index 98eec9d..0000000
--- a/gnustep/hangman.app/Resources/Info-gnustep.plist
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "!" = "Generated by ProjectCenter, do not edit";
- ApplicationDescription = "The classical hang man game.";
- ApplicationIcon = "icon.png";
- ApplicationName = hangman;
- ApplicationRelease = "1.0";
- Authors = (
- "Pascal J. Bourguignon"
- );
- Copyright = "Copyright (C) 2014 Pascal Bourguignon";
- CopyrightDescription = "Released under the AGPL3.";
- FullVersionID = "1.0";
- GSMainMarkupFile = "";
- NOTE = "Automatically generated, do not edit!";
- NSExecutable = hangman;
- NSIcon = "icon.png";
- NSMainNibFile = "hangman.gorm";
- NSPrincipalClass = NSApplication;
- NSRole = Application;
-}
\ No newline at end of file
diff --git a/gnustep/hangman.app/Resources/Main.gsmarkup b/gnustep/hangman.app/Resources/Main.gsmarkup
deleted file mode 100644
index e403420..0000000
--- a/gnustep/hangman.app/Resources/Main.gsmarkup
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0"?>
-<!DOCTYPE gsmarkup>
-<gsmarkup>
-
- <objects>
- <window/>
- </objects>
-</gsmarkup>
diff --git a/gnustep/hangman.app/Resources/MainMenu-GNUstep.gsmarkup b/gnustep/hangman.app/Resources/MainMenu-GNUstep.gsmarkup
deleted file mode 100644
index ff72d59..0000000
--- a/gnustep/hangman.app/Resources/MainMenu-GNUstep.gsmarkup
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<!DOCTYPE gsmarkup>
-
-<!-- Remove any menu items and submenus which you don't need. Add any
- menu items and submenus which you need. -->
-
-<gsmarkup>
- <objects>
-
- <menu type="main">
-
- <menu title="Info">
- <menuItem title="Info Panel..."
- action="orderFrontStandardInfoPanel:"/>
- <menuItem title="Preferences..." action=""/>
- <menuItem title="Help..." action="orderFrontHelpPanel:" key="?"/>
- </menu>
-
- <menu title="Windows">
- <menuItem title="Arrange In Front" action="arrangeInFront:"/>
- <menuItem title="Miniaturize Window" action="performMiniaturize:"
- key="m"/>
- <menuItem title="Close Window" action="performClose:" key="w"/>
- </menu>
-
- <menu title="Services" type="services"/>
-
- <menuItem title="Hide" action="hide:" key="h"/>
- <menuItem title="Quit" action="terminate:" key="q"/>
- </menu>
- </objects>
-</gsmarkup>
diff --git a/gnustep/hangman.app/Resources/MainMenu-OSX.gsmarkup b/gnustep/hangman.app/Resources/MainMenu-OSX.gsmarkup
deleted file mode 100644
index a20024f..0000000
--- a/gnustep/hangman.app/Resources/MainMenu-OSX.gsmarkup
+++ /dev/null
@@ -1,63 +0,0 @@
-<?xml version="1.0"?>
-<!DOCTYPE gsmarkup>
-
-<gsmarkup>
- <objects>
-
- <menu type="main">
-
- <menu title="MyApplication" type="apple">
- <menuItem title="About MyApplication"
- action="orderFrontStandardAboutPanel:"/>
- <menuSeparator/>
- <menuItem title="Preferences..." action="runPreferencesPanel:"/>
- <menu title="Services" type="services"/>
- <menuSeparator/>
- <menuItem title="Hide MyApplication" action="hide:" key="h"/>
- <menuItem title="Hide Others" action="hideOtherApplications:"/>
- <menuItem title="Show All" action="unhideAllApplications:"/>
- <menuSeparator/>
- <menuItem title="Quit MyApplication" action="terminate:" key="q"/>
- </menu>
-
- <menu title="File">
- <menuItem title="New" action="" key="n"/>
- <menuItem title="Open..." action="" key="o"/>
- <menu title="Open Recent" type="openRecent">
- <menuItem title="Clear menu" action=""/>
- </menu>
- <menuSeparator/>
- <menuItem title="Close" action="performClose:" key="w"/>
- <menuItem title="Save" action="" key="s"/>
- <menuItem title="Save As..." action="" key="S"/>
- <menuItem title="Revert" action=""/>
- <menuSeparator/>
- <menuItem title="Page Setup..." action="runPageLayout:" key="P"/>
- <menuItem title="Print..." action="print:" key="p"/>
- </menu>
-
- <menu title="Edit">
- <menuItem title="Undo" action="undo:" key="z"/>
- <menuItem title="Redo" action="redo:" key="Z"/>
- <menuSeparator/>
- <menuItem title="Cut" action="cut:" key="x"/>
- <menuItem title="Copy" action="copy:" key="c"/>
- <menuItem title="Paste" action="paste:" key="v"/>
- <menuItem title="Delete" action="delete:"/>
- <menuItem title="Select All" action="selectAll:" key="a"/>
- </menu>
-
- <menu title="Window" type="windows">
- <menuItem title="Close Window" action="performClose:" key="w"/>
- <menuItem title="Minimize Window" action="performMiniaturize:"
- key="m"/>
- <menuSeparator/>
- <menuItem title="Bring All to Front" action="arrangeInFront:" key=""/>
- </menu>
-
- <menu title="Help">
- <menuItem title="MyApplication Help" action="showHelp:" key="?"/>
- </menu>
- </menu>
- </objects>
-</gsmarkup>
diff --git a/gnustep/hangman.app/Resources/hangman.desktop b/gnustep/hangman.app/Resources/hangman.desktop
deleted file mode 100755
index eabd777..0000000
--- a/gnustep/hangman.app/Resources/hangman.desktop
+++ /dev/null
@@ -1,9 +0,0 @@
-[Desktop Entry]
-Encoding=UTF-8
-Type=Application
-Categories=X-GNUstep;
-Name=hangman
-Comment=The classical hang man game.
-Icon=/usr/local/lib/GNUstep/Applications/hangman.app/Resources/icon.png
-Exec=/usr/bin/openapp hangman
-FilePattern=hangman.app;hangman;
diff --git a/gnustep/hangman.app/Resources/hangman.gorm/data.classes b/gnustep/hangman.app/Resources/hangman.gorm/data.classes
deleted file mode 100644
index 609f469..0000000
--- a/gnustep/hangman.app/Resources/hangman.gorm/data.classes
+++ /dev/null
@@ -1,46 +0,0 @@
-{
- "## Comment" = "Do NOT change this file, Gorm maintains it";
- AppController = {
- Actions = (
- "showPrefPanel:"
- );
- Outlets = (
- );
- Super = NSObject;
- };
- FirstResponder = {
- Actions = (
- "anotherWord:",
- "controler:",
- "newGame:",
- "orderFrontFontPanel:",
- "selectLetter:",
- "showPrefPanel:",
- "tryALetter:",
- "willQuit:"
- );
- Super = NSObject;
- };
- HangmanController = {
- Actions = (
- "selectLetter:",
- "newGame:"
- );
- Outlets = (
- image,
- letters,
- message,
- guessed
- );
- Super = NSObject;
- };
- WindW = {
- Actions = (
- "controler:"
- );
- Outlets = (
- controler
- );
- Super = NSObject;
- };
-}
\ No newline at end of file
diff --git a/gnustep/hangman.app/Resources/hangman.gorm/data.info b/gnustep/hangman.app/Resources/hangman.gorm/data.info
deleted file mode 100644
index 234dcc8..0000000
Binary files a/gnustep/hangman.app/Resources/hangman.gorm/data.info and /dev/null differ
diff --git a/gnustep/hangman.app/Resources/hangman.gorm/objects.gorm b/gnustep/hangman.app/Resources/hangman.gorm/objects.gorm
deleted file mode 100644
index c9aa3e0..0000000
Binary files a/gnustep/hangman.app/Resources/hangman.gorm/objects.gorm and /dev/null differ
diff --git a/gnustep/hangman.app/Resources/hung-0.png b/gnustep/hangman.app/Resources/hung-0.png
deleted file mode 100644
index d4eacb0..0000000
Binary files a/gnustep/hangman.app/Resources/hung-0.png and /dev/null differ
diff --git a/gnustep/hangman.app/Resources/hung-1.png b/gnustep/hangman.app/Resources/hung-1.png
deleted file mode 100644
index eda3dc8..0000000
Binary files a/gnustep/hangman.app/Resources/hung-1.png and /dev/null differ
diff --git a/gnustep/hangman.app/Resources/hung-10.png b/gnustep/hangman.app/Resources/hung-10.png
deleted file mode 100644
index a33aa80..0000000
Binary files a/gnustep/hangman.app/Resources/hung-10.png and /dev/null differ
diff --git a/gnustep/hangman.app/Resources/hung-11.png b/gnustep/hangman.app/Resources/hung-11.png
deleted file mode 100644
index 7af18a9..0000000
Binary files a/gnustep/hangman.app/Resources/hung-11.png and /dev/null differ
diff --git a/gnustep/hangman.app/Resources/hung-2.png b/gnustep/hangman.app/Resources/hung-2.png
deleted file mode 100644
index 1690e71..0000000
Binary files a/gnustep/hangman.app/Resources/hung-2.png and /dev/null differ
diff --git a/gnustep/hangman.app/Resources/hung-3.png b/gnustep/hangman.app/Resources/hung-3.png
deleted file mode 100644
index 70b3501..0000000
Binary files a/gnustep/hangman.app/Resources/hung-3.png and /dev/null differ
diff --git a/gnustep/hangman.app/Resources/hung-4.png b/gnustep/hangman.app/Resources/hung-4.png
deleted file mode 100644
index 814ad5f..0000000
Binary files a/gnustep/hangman.app/Resources/hung-4.png and /dev/null differ
diff --git a/gnustep/hangman.app/Resources/hung-5.png b/gnustep/hangman.app/Resources/hung-5.png
deleted file mode 100644
index 7e42e79..0000000
Binary files a/gnustep/hangman.app/Resources/hung-5.png and /dev/null differ
diff --git a/gnustep/hangman.app/Resources/hung-6.png b/gnustep/hangman.app/Resources/hung-6.png
deleted file mode 100644
index a3bf17c..0000000
Binary files a/gnustep/hangman.app/Resources/hung-6.png and /dev/null differ
diff --git a/gnustep/hangman.app/Resources/hung-7.png b/gnustep/hangman.app/Resources/hung-7.png
deleted file mode 100644
index 4f4586b..0000000
Binary files a/gnustep/hangman.app/Resources/hung-7.png and /dev/null differ
diff --git a/gnustep/hangman.app/Resources/hung-8.png b/gnustep/hangman.app/Resources/hung-8.png
deleted file mode 100644
index a347ba0..0000000
Binary files a/gnustep/hangman.app/Resources/hung-8.png and /dev/null differ
diff --git a/gnustep/hangman.app/Resources/hung-9.png b/gnustep/hangman.app/Resources/hung-9.png
deleted file mode 100644
index 61734a4..0000000
Binary files a/gnustep/hangman.app/Resources/hung-9.png and /dev/null differ
diff --git a/gnustep/hangman.app/Resources/icon.png b/gnustep/hangman.app/Resources/icon.png
deleted file mode 100644
index 2a28c6a..0000000
Binary files a/gnustep/hangman.app/Resources/icon.png and /dev/null differ
diff --git a/gnustep/hangman.app/hangman b/gnustep/hangman.app/hangman
deleted file mode 100755
index 50db19a..0000000
Binary files a/gnustep/hangman.app/hangman and /dev/null differ
diff --git a/gnustep/hangman.app/stamp.make b/gnustep/hangman.app/stamp.make
deleted file mode 100644
index ab0f150..0000000
--- a/gnustep/hangman.app/stamp.make
+++ /dev/null
@@ -1 +0,0 @@
-OLD_GNUSTEP_STAMP_ASTRING = _NSApplication-icon.png--
diff --git a/gnustep/hangman.pcproj/PC.project b/gnustep/hangman.pcproj/PC.project
index 8f86e94..28d78da 100644
--- a/gnustep/hangman.pcproj/PC.project
+++ b/gnustep/hangman.pcproj/PC.project
@@ -1,5 +1,5 @@
{
- APPLICATIONICON = "icon.png";
+ APPLICATIONICON = "icon.jpeg";
"APP_DOCUMENT_BASED" = NO;
"APP_TYPE" = GORM;
"BUILDER_TARGETS" = (
@@ -26,19 +26,19 @@
"HangmanController.h"
);
IMAGES = (
- "hung-0.png",
- "hung-1.png",
- "hung-10.png",
- "hung-11.png",
- "hung-2.png",
- "hung-3.png",
- "hung-4.png",
- "hung-5.png",
- "hung-6.png",
- "hung-7.png",
- "hung-8.png",
- "hung-9.png",
- "icon.png"
+ "hung-0.jpeg",
+ "hung-1.jpeg",
+ "hung-10.jpeg",
+ "hung-11.jpeg",
+ "hung-2.jpeg",
+ "hung-3.jpeg",
+ "hung-4.jpeg",
+ "hung-5.jpeg",
+ "hung-6.jpeg",
+ "hung-7.jpeg",
+ "hung-8.jpeg",
+ "hung-9.jpeg",
+ "icon.jpeg"
);
INSTALLDIR = "$(HOME)/GNUstep";
INTERFACES = (
diff --git a/gnustep/hangmanInfo.plist b/gnustep/hangmanInfo.plist
index 69fe62b..5283840 100644
--- a/gnustep/hangmanInfo.plist
+++ b/gnustep/hangmanInfo.plist
@@ -1,7 +1,7 @@
{
"!" = "Generated by ProjectCenter, do not edit";
ApplicationDescription = "The classical hang man game.";
- ApplicationIcon = "icon.png";
+ ApplicationIcon = "icon.jpeg";
ApplicationName = hangman;
ApplicationRelease = "1.0";
Authors = (
@@ -11,7 +11,7 @@
CopyrightDescription = "Released under the AGPL3.";
FullVersionID = "1.0";
NSExecutable = hangman;
- NSIcon = "icon.png";
+ NSIcon = "icon.jpeg";
NSMainNibFile = "hangman.gorm";
NSPrincipalClass = NSApplication;
NSRole = Application;
diff --git a/sources/Hangman.m b/sources/Hangman.m
index cb36c75..b9c80ce 100644
--- a/sources/Hangman.m
+++ b/sources/Hangman.m
@@ -38,12 +38,12 @@
-(void)initializeFound{
NSInteger length=[word length];
- found=[NSMutableArray arrayWithCapacity:length];
+ found=RETAIN(([NSMutableArray arrayWithCapacity:length]));
for(NSInteger i=0;i<length;i++){
[found addObject:no];
}
- [found setObject:yes atIndexedSubscript:0];
- [found setObject:yes atIndexedSubscript:[found count]-1];
+ [found replaceObjectAtIndex:0 withObject:yes];
+ [found replaceObjectAtIndex:([found count]-1) withObject:yes];
}
-(id)initWithWord:(NSString*)aWord maximumErrorCount:(NSInteger)aMaximumErrorCount
@@ -51,12 +51,12 @@
if((self=[super init])) {
missingLetter=@".";
alphabet=@"abcdefghijklmnopqrstuvwxyz";
- yes=[NSNumber numberWithBool:YES];
- no=[NSNumber numberWithBool:NO];
+ yes=RETAIN(([NSNumber numberWithBool:YES]));
+ no=RETAIN(([NSNumber numberWithBool:NO]));
- word=[aWord lowercaseString];
+ word=RETAIN(([aWord lowercaseString]));
[self initializeFound];
- triedLetters=[NSMutableString stringWithCapacity:[alphabet length]];
+ triedLetters=RETAIN(([NSMutableString stringWithCapacity:[alphabet length]]));
currentErrorCount=0;
maximumErrorCount=aMaximumErrorCount;
}
@@ -103,7 +103,7 @@
r=[word rangeOfString:letter];
while(r.length>0){
error=NO;
- [found setObject:yes atIndexedSubscript:r.location];
+ [found replaceObjectAtIndex:r.location withObject:yes];
NSInteger start=r.location+r.length;
NSRange searchRange=NSMakeRange(start,length-start);
r=[word rangeOfString:letter options:NSCaseInsensitiveSearch range:searchRange];
diff --git a/sources/HangmanController.m b/sources/HangmanController.m
index b4962fe..e1aac5d 100644
--- a/sources/HangmanController.m
+++ b/sources/HangmanController.m
@@ -32,28 +32,42 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//****************************************************************************
#include "HangmanController.h"
-#include <stdlib.h> // for rand().
+#include <stdlib.h>
+#include <unistd.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
@implementation HangmanController
-
-(id)initWithFrame:(NSRect)frame {
if((self=[super initWithFrame:frame])){
- words=[NSArray arrayWithObjects:@"along", @"and", @"andor", @"any", @"buffer", @"but", @"can",
- @"copy", @"create", @"details", @"distributed", @"either", @"enter",
- @"evaluation", @"even", @"file", @"fitness", @"for", @"foundation",
- @"free", @"general", @"gnu", @"have", @"hope", @"implied", @"later",
- @"license", @"lisp", @"merchantability", @"modify", @"more", @"not",
- @"notes", @"option", @"own", @"particular", @"program", @"public",
- @"published", @"purpose", @"received", @"redistribute", @"save",
- @"see", @"should", @"software", @"terms", @"text", @"that", @"the",
- @"then", @"this", @"under", @"useful", @"version", @"visit", @"want",
- @"warranty", @"will", @"with", @"without", @"you", @"your",nil];
+ words=RETAIN(([NSArray arrayWithObjects:@"along", @"and", @"andor", @"any", @"buffer", @"but", @"can",
+ @"copy", @"create", @"details", @"distributed", @"either", @"enter",
+ @"evaluation", @"even", @"file", @"fitness", @"for", @"foundation",
+ @"free", @"general", @"gnu", @"have", @"hope", @"implied", @"later",
+ @"license", @"lisp", @"merchantability", @"modify", @"more", @"not",
+ @"notes", @"option", @"own", @"particular", @"program", @"public",
+ @"published", @"purpose", @"received", @"redistribute", @"save",
+ @"see", @"should", @"software", @"terms", @"text", @"that", @"the",
+ @"then", @"this", @"under", @"useful", @"version", @"visit", @"want",
+ @"warranty", @"will", @"with", @"without", @"you", @"your",nil]));
loadedWords=nil;}
return(self);}
+-(void)initializeRandom{
+ int fd=open("/dev/random",O_RDONLY,0);
+ if(fd>=0){
+ int seed;
+ ssize_t res=read(fd,&seed,sizeof(seed));
+ if(res==sizeof(seed)){
+ srand(seed);}
+ close(fd);}}
+
+
-(void)awakeFromNib{
+ [self initializeRandom];
[self connectUI];}
@@ -151,6 +165,7 @@
-(void)setHangImage:(NSInteger)index{
if((0<=index)&&(index<=[self maximumErrorCount])){
NSImage* hungImage=[NSImage imageNamed:[NSString stringWithFormat:@"hung-%ld",(long)index]];
+ NSLog(@"name=%@ hungImage=%@",[NSString stringWithFormat:@"hung-%ld",(long)index],hungImage);
[image setImage:hungImage];}}