| [x] | Aktuell | Seminare | Reports | Homepage | Software | |||
|
| ||||||||
|
@informatik.hu-berlin.de Reports - postindustr.CC - XML/Ti Report - pTA StudienArbeit . - sch_llf study - Geschichte des PC TechDocs - Perl Objects - Installing Oracle - shell cmds in python - Using css for xml defs tricks - Unsafe mono [x] ! - Docbook Manpages - Java Bean Code rpm-suse - schema-mappingen ig cv hg re dv ev zz mk pr - java problemsen lang swing ext gtk jjtree xul boot -grub-netboot -grub-gtk -partclone freshmeat -partimage links -releaseuploader -guidod-pygtk
2005-03-23
|
handling and compiling unsafe code with monoAdvances in Programming Languages: Coursework 1This is an assessed practical exercise. The practical exercises on the course constitute 20% of the final mark of the course. The practical exercises are equally weighted and they are individual practical exercises. This means that your submission should be entirely your own work unless you declare it to be otherwise. Please see the School of Informatics guidelines on plagiarism for further clarification. 1. TaskYou have been hired by Advanced Software Ltd to produce an open-source version of one of their popular games, which they no longer wish to maintain. The problem with the game at present is that it uses unsafe coding practices. Advanced Software Ltd is worried that their share price may fall if it becomes public that some of their developers sometimes use unsafe programming techniques, so a rewrite is necessary. In order to maintain the reputation of the company as a top-shelf software house your program should be portable across the Windows and Linux platforms. Your task is to modify a C# version of Minesweeper that was ported from the highly-regarded Minesweeper game developed by Chailloux, Manoury and Pagano for the O'Reilly book Développement d'applications avec Objective Caml (version written in Objective Caml). The programmers on the project, who have had mainly C programming experience, have made frequent use of the unsafe keyword in C# to gain access to certain language features. Your project manager believes that none of these unsafe contexts are really necessary, and all could have been coded safely. You are to rewrite the program so that no remaining parts are marked with unsafe. Your refactored application is expected to look and behave as it did before you modified it. At present, the application will only compile when the unsafe flag for the C# compiler is enabled. Your final program should compile without using this as it should have no code marked as unsafe. 2. Compiling and Running the ApplicationStart by downloading the application source code contained in the Game.cs file. The program can be compiled and executed under both Windows and Linux. You have a choice of which one you use whilst completing the practical, but bear in mind that your result should be portable. In particular, it should compile using Mono on a Linux machine, not only under the latest release of VisualStudio. However, choose whichever development environment you prefer, or you are most used to. The Minesweeper application depends on a graphics library called GTK#. If you wish to develop on your own machine you will need to get a copy of this library and a C# compiler. 2.1 Developing on a Linux DICE machineThe GTK# libraries are expected to be available under DiCE. Check this using the following command:rpm -ql gtk-sharp gtk-sharp-develIf you get the message package gtk-sharp is not installed or package gtk-sharp-devel is not installed then you should contact Informatics support providing a full explanation of the problem. (Use this form.)
When the program code no longer contains any unsafe keywords, you can remove the --unsafe switch from step 1. At that point the program may also work with the Mono JIT so you can try also mono Game.exe. Unsafe code is unlikely to work with the Mono JIT. 2.2 Developing on your own Linux machineMake a copy of this release of GTK# or (at your peril) another version. Do the configure-make-install dance and then proceed with compiling and running as above.2.3 Developing with the Mono compiler under WindowsThe Mono C# compiler is freely available for Windows.
When the program code no longer contains any unsafe keywords, you can remove the -unsafe switch from step 4. 2.4 Developing with VisualStudio.NET under WindowsIf you have a copy of the (non-free) software VisualStudio.NET you can use the following development sequence.
DeadlineThis coursework exercise has been issued on Thursday 3rd February 2005 and is due for submission on Thursday 17th February 2005 at 5:00pm. Submit your code using the command submit cs4 apl 1 Game.cs.This page maintained by Stephen Gilmore.
| |||||||