COMP1110 課業(yè)解析

題意:

實(shí)現(xiàn)一個(gè)IQ-focus的棋盤游戲的編碼系統(tǒng)

解析:

使用JavaFx搭建一個(gè)可視化的棋盤游戲,將游戲挑戰(zhàn)的方塊編碼為一個(gè)”Challenge String“,根據(jù)挑戰(zhàn)方塊的顏色編碼成'W' , 'R' ,'G', 'B'令境; 將游戲現(xiàn)在的狀態(tài)編碼成”Placement Strings“,使用文檔中幾種預(yù)設(shè)的方塊,格式為四位,分別描述其形狀馏臭、所在列,所在行和方向讼稚。

涉及知識(shí)點(diǎn):

JavaFx括儒,多維數(shù)組,字符串處理

更多可加微信撩騷

comp1110 / comp1110-ass2?

Academic Honesty and Integrity

Honesty and integrity are of utmost importance. These goals are not at odds with being resourceful and working collaboratively. You should be resourceful, you should collaborate within your team, and you should discuss the assignment and other aspects of the course with others taking the class. However, you must never misrepresent the work of others as your own. If you have taken ideas from elsewhere or used code sourced from elsewhere, you must say so with utmost clarity. At each stage of the assignment you will be asked to submit a statement of originality, either as a group or as individuals. This statement is the place for you to declare which ideas or code contained in your submission were sourced from elsewhere.

Please read the ANU's official position on academic honesty. If you have any questions, please ask me.

Carefully review the statement of originality which you must complete. Edit that statement and update it as you complete each state of the assignment, ensuring that when you complete each stage, a truthful statement is committed and pushed to your repo.

Purpose

In this assignment you will work as a group to master a number of major themes of this course, including software design and implementation, using development tools such as Git and IntelliJ, and using JavaFX to build a user interface. Above all, this assignment will emphasize group work; while you will receive an individual mark for your work based on your contributions to the assignment, you can only succeed if all members contribute to your group's success.

Assignment Deliverables

The assignment is worth 25% of your total assessment, and it will be marked out of 25. So each mark in the assignment corresponds to a mark in your final assessment for the course. Note that for some stages of the assignment you will get a group mark, and for others you will be individually marked. The mark breakdown and the due dates are described on the deliverables page.

Your work will be marked via your tutor accessing git, so it is essential that you carefully follow instructions for setting up and maintaining your group repository. At each deadline you will be marked according to whatever is committed to your repository at the time of the deadline. You will be assessed on how effectively you use git as a development tool.

Problem Description

The assignment involves implementing in Java, a board game called IQ-focus made by the games developer SmartGames.


Objective

The game is a puzzle. At the start, the player selects a challenge which defines the color of each of the nine squares in the central board area. The objective is to place all ten colored playing pieces onto a board comprising 43 locations (indents). The player must place the pieces such that they: a) fit together correctly on the board, without overlaps or gaps, and b) satisfy the challenge.

A completed game:

To help you visualize the game, we have provided a paper version, which you can cut out.

Challenges

A game starts by choosing a challenge which specifies the color of the nine central squares. Here is the chosen challenge for the game above (this happens to be challenge 1 that comes with the game):

Interestingly, although all challenges are specified only in terms of the arrangement of colors in the nine central squares, some challenges are much easier to solve than others. If you attempt the harder tasks, you may want to reflect on what makes some challenges so much easier than others. Note that as a general rule for puzzles, the more constrained the player is, the fewer options they have, and consequently the solution to the challenge is simpler.

Solutions

Each challenge has just one solution. When we refer to solutions, we ignore piece rotations that take up the same space on the board. Such rotations are described as symmetric, which is defined in more detail below.

The following sequence shows one possible progression of a solution to the game above (note that the order in which the pieces are played is not important; this is just one possible ordering).

Board

The game is played on a board comprised of 43 locations arranged in a 9x5 grid. In the real-world game, each location consists of a square indent into which a piece may fit. In our game, locations are encoded as two digits, the first one identifying the column from 0 to 8 , followed by another identifying the row from 0 to 4 . For example, in the game above, the first piece is put on position 30 and the second is put on 32 . Note that pieces are addressed as XY where X identifies the column where the left-most square of the piece is in, and Y identifies the row where the top square of the piece is in. Yellow dots in the diagram above indicate the point of reference (i.e. the top-most row and left-most column occupied by the piece).

Pieces

The game comprises 10 playing shapes, each of which is made of plastic and consists of three, four, or five connected squares (see the photo above). The pieces fit neatly into the indents in the plastic board formed by the 43 locations.

Each piece can be rotated at 90 degree increments, allowing for 4 different orientations. The following illustration shows all 40 possible combinations of the 10 pieces and 4 orientations. (Yellow dots indicate the point of reference for the piece's location, described below).

Strict Symmetry

Notice that piece f and piece g are symmetric, so rotating them twice will not change the shape (for example fxy0 is identical to fxy2 ). We describe that as 'strictly symmetric'. We ignore the redundant rotations with higher numberings (e.g. fxy2 , fxy3 , gxy2 and gxy3 are ignored).

Legal Piece Placements

For a piece placement to be valid, the following must be true:

All squares comprising each piece must be placed on valid board locations (no part of a piece may be off the board).

All squares comprising each piece must be placed on vacant board locations (pieces may not overlap).

Encoding Game State and Challenge

Game states and challenges are encoded as strings. Your game will need to be able to initialize itself using these strings and some of your tasks relate directly to these strings.

Challenge Strings

A challenge string consists of a sequence of exactly nine characters, each describing the color of one square in the central 3x3 board area. There are four colors: White , Red , Blue and Green , which are encoded as 'W' , 'R' , 'B' and 'G' respectively.

For the sample challenge below, the challenge string is "RRRBWBBRB" , which is achieved by tracing the central board area with this order:

Placement Strings

A placement string consists of between one and ten (inclusive) piece placements (pieces a to j ). The placement string may not include any piece twice. A completed game must include ten piece placements. Each piece placement is described using four characters. For example, the game described above is characterized (when complete) by the string "a000b013c113d302e323f400g420h522i613j701" . Note that the placement string is ordered (piece a first, and piece j last), which is a requirement for valid placement strings.

Piece Placement Strings

A piece placement string consists of four characters describing the location and orientation of one particular piece on the board:

The first character identifies which of the ten shapes is being placed ( a to j ).

The second character identifies which column the left of the piece is in (columns are labelled 0 to 9 ).

The third character identifies which row the top of the piece is in (rows are labelled 0 to 4 ).

The fourth character identifies which orientation the piece is in ( 0 to 3 for four rotations as illustrated above).

The image above shows the first and fourth characters for each of the pieces in each of their orientations (40 in total). For example, at top left, 'a0' describes piece 'a' at orientation '0'. Below it, 'b0' describes piece 'b' at orientation '0'. At the bottom right 'j3' describes piece 'j' at orientation '3'. And so on. A piece placement string starts and ends with these two characters and has two more in between which describe where the piece is placed.

Legal and Ethical Issues

First, as with any work you do, you must abide by the principles of honesty and integrity. You are expected to demonstrate honesty and integrity in everything you do.

In addition to those ground rules, you are to follow the rules one would normally be subject to in a commercial setting. In particular, you may make use of the works of others under two fundamental conditions: a) your use of their work must be clearly acknowledged, and b) your use of their work must be legal (for example, consistent with any copyright and licensing that applies to the given material). Please understand that violation of these rules is a very serious offence. However, as long as you abide by these rules, you are explicitly invited to conduct research and make use of a variety of sources. You are also given an explicit means with which to declare your use of other sources (via originality statements you must complete). It is important to realize that you will be assessed on the basis of your original contributions to the project. While you won't be penalized for correctly attributed use of others' ideas, the work of others will not be considered as part of your contribution. Therefore, these rules allow you to copy another student's work entirely if: a) they gave you permission to do so, and b) you acknowledged that you had done so. Notice, however, that if you were to do this you would have no original contribution and so would receive no marks for the assignment (but you would not have broken any rules either).

Evaluation Criteria

It is essential that you refer to the deliverables page to check that you understand each of the deadlines and what is required. Your assignment will be marked via tests run through git's continuous integration (CI) framework, so all submittable materials will need to be in git and in the correct locations, as prescribed by the deliverables page.

The mark breakdown is described on the deliverables page.

Part One

In the first part of the assignment you will:

Implement parts of the text interface to the game (Tasks #2, and #3).

Implement a simple viewer that allows you to visualize game states (Task #4).

The criteria for the completion of part one is as follows:

Pass

Tasks #2 and #3

Credit

Task #4 (in addition to all tasks required for Pass)

Distinction

Task #5 (in addition to all tasks required for Credit)

Part Two

Create a fully working game, using JavaFX to implement a playable graphical version of the game in a 933x700 window.

Notice that aside from the window size, the details of exactly how the game looks etc, are intentionally left up to you. The diagrams above are for illustration purposes only, although you are welcome to use all of the resources provided in this repo, including the bitmap images for each of the eight shapes.?

The only firm requirements are that:

you use Java and JavaFX,

the game respects the specification of the game given here,

the game be easy to play,

it runs in a 933x700 window, and

that it is executable on a standard lab machine from a jar file called game.jar ,

Your game must successfully run from game.jar from within another user's (i.e. your tutor's) account on a standard lab machine (in other words, your game must not depend on features not self-contained within that jar file and the Java 11 runtime).

Pass

Correctly implements all of the Part One criteria.

Appropriate use of git (as demonstrated by the history of your repo).

Completion of Task #6

Executable on a standard lab computer from a runnable jar file, game.jar, which resides in the root level of your group repo.

Credit

All of the Pass-level criteria, plus the following...

Task #7

Distinction

All of the Credit-level criteria, plus the following...

Tasks #8 and #9

High Distinction

All of the Distinction-level criteria, plus the following...

Tasks #10 and #11

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
  • 序言:七十年代末锐想,一起剝皮案震驚了整個(gè)濱河市帮寻,隨后出現(xiàn)的幾起案子,更是在濱河造成了極大的恐慌赠摇,老刑警劉巖固逗,帶你破解...
    沈念sama閱讀 212,222評(píng)論 6 493
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件,死亡現(xiàn)場(chǎng)離奇詭異藕帜,居然都是意外死亡烫罩,警方通過查閱死者的電腦和手機(jī),發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 90,455評(píng)論 3 385
  • 文/潘曉璐 我一進(jìn)店門洽故,熙熙樓的掌柜王于貴愁眉苦臉地迎上來贝攒,“玉大人,你說我怎么就攤上這事收津《稣猓” “怎么了浊伙?”我有些...
    開封第一講書人閱讀 157,720評(píng)論 0 348
  • 文/不壞的土叔 我叫張陵,是天一觀的道長长捧。 經(jīng)常有香客問我嚣鄙,道長,這世上最難降的妖魔是什么串结? 我笑而不...
    開封第一講書人閱讀 56,568評(píng)論 1 284
  • 正文 為了忘掉前任哑子,我火速辦了婚禮,結(jié)果婚禮上肌割,老公的妹妹穿的比我還像新娘卧蜓。我一直安慰自己,他們只是感情好把敞,可當(dāng)我...
    茶點(diǎn)故事閱讀 65,696評(píng)論 6 386
  • 文/花漫 我一把揭開白布弥奸。 她就那樣靜靜地躺著,像睡著了一般奋早。 火紅的嫁衣襯著肌膚如雪盛霎。 梳的紋絲不亂的頭發(fā)上,一...
    開封第一講書人閱讀 49,879評(píng)論 1 290
  • 那天耽装,我揣著相機(jī)與錄音愤炸,去河邊找鬼。 笑死掉奄,一個(gè)胖子當(dāng)著我的面吹牛规个,可吹牛的內(nèi)容都是我干的。 我是一名探鬼主播姓建,決...
    沈念sama閱讀 39,028評(píng)論 3 409
  • 文/蒼蘭香墨 我猛地睜開眼诞仓,長吁一口氣:“原來是場(chǎng)噩夢(mèng)啊……” “哼!你這毒婦竟也來了引瀑?” 一聲冷哼從身側(cè)響起狂芋,我...
    開封第一講書人閱讀 37,773評(píng)論 0 268
  • 序言:老撾萬榮一對(duì)情侶失蹤榨馁,失蹤者是張志新(化名)和其女友劉穎憨栽,沒想到半個(gè)月后,有當(dāng)?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體翼虫,經(jīng)...
    沈念sama閱讀 44,220評(píng)論 1 303
  • 正文 獨(dú)居荒郊野嶺守林人離奇死亡屑柔,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點(diǎn)故事閱讀 36,550評(píng)論 2 327
  • 正文 我和宋清朗相戀三年,在試婚紗的時(shí)候發(fā)現(xiàn)自己被綠了珍剑。 大學(xué)時(shí)的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片掸宛。...
    茶點(diǎn)故事閱讀 38,697評(píng)論 1 341
  • 序言:一個(gè)原本活蹦亂跳的男人離奇死亡,死狀恐怖招拙,靈堂內(nèi)的尸體忽然破棺而出唧瘾,到底是詐尸還是另有隱情措译,我是刑警寧澤,帶...
    沈念sama閱讀 34,360評(píng)論 4 332
  • 正文 年R本政府宣布饰序,位于F島的核電站领虹,受9級(jí)特大地震影響,放射性物質(zhì)發(fā)生泄漏求豫。R本人自食惡果不足惜塌衰,卻給世界環(huán)境...
    茶點(diǎn)故事閱讀 40,002評(píng)論 3 315
  • 文/蒙蒙 一、第九天 我趴在偏房一處隱蔽的房頂上張望蝠嘉。 院中可真熱鬧最疆,春花似錦、人聲如沸蚤告。這莊子的主人今日做“春日...
    開封第一講書人閱讀 30,782評(píng)論 0 21
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽杜恰。三九已至蚊逢,卻和暖如春,著一層夾襖步出監(jiān)牢的瞬間箫章,已是汗流浹背烙荷。 一陣腳步聲響...
    開封第一講書人閱讀 32,010評(píng)論 1 266
  • 我被黑心中介騙來泰國打工, 沒想到剛下飛機(jī)就差點(diǎn)兒被人妖公主榨干…… 1. 我叫王不留檬寂,地道東北人终抽。 一個(gè)月前我還...
    沈念sama閱讀 46,433評(píng)論 2 360
  • 正文 我出身青樓,卻偏偏與公主長得像桶至,于是被迫代替她去往敵國和親昼伴。 傳聞我的和親對(duì)象是個(gè)殘疾皇子,可洞房花燭夜當(dāng)晚...
    茶點(diǎn)故事閱讀 43,587評(píng)論 2 350

推薦閱讀更多精彩內(nèi)容