10 November 2009

XNA game progress

I have been working on getting the computer to play. The simplest approach is to have it pick random pieces to move, and keep trying till it finds a legal move. This isn't a good approach, it loses every time, I just want to get the flow of the game going.

The game I am writing involves two players taking turns to roll two dice and move one or two of their pieces. Unfortunately, the computer move is instantaneous so it makes it difficult to see what is happening. I need to add some delays. I might leave this until I put the code into
XNA.

03 November 2009

Notes on Open University Course T206_2 An introduction to

4 Renewable Energy Sources
Most renewables originate from the sunTidal from gravityGeothermal from heat trapped in the earth Solar-thermal-PV
Indirect solar-Wind-WaveThese will be renewed naturally, won't run out.
Presently more expensive than fossil fuels but attractive
due to lower environmental impacts
5 Energy Services and Efficiency Improvement
Efficiency : 2 thirds of the energy ends up as waste heat
Energy has been reducing in price so little incentive to
attempt to improve efficiency.
Supply side: generation efficiency can be improved...Combined Cycle Gas Turbine (CCGT) uses hot exhaust gases
from gas turbine generator to power a steam generator.CHP Combine Heat and Power, uses waste heat from power
stations to heat buildings8% of energy lost through transmission/distribution
Demand side:More efficient appliances (must be wary of embedded carbon,
co2 produced in the creation of a new appliance can outweigh
any benefit from energy saved in use) Social changes (walking cycling to work, public transport)
Four sectors: Domestic (draught proofing, insulation) Commercial & Institutional Industrial (reuse waste heat, product design, thinner
materials) Transport
6 Energy in a Sustainable Future
How to improve sustainability:Carbon sequestration (storing carbon so it cannot get back
into atmosphere)Fuels switching - to less polluting fuelsSwitching to renewablesDemand side efficiency improvements
Royal Commission on Environmental Pollution (RCEP) proposed
four scenarios for the UK which consider the options
available for balancing supply with demand given the need to
reduce CO2 emissions by 60%.
World Energy Council has come up with six scenarios
incorporating different assumptions about rates of economic
growth in rich and poor countries; choices of technology and
its development; and the priority given to ecological issues
A number of paths to sustainability, but, since they rely on
different mixes of technology, they are likely to have
different social, environmental and political implications.

Writing an XNA Game

I'm writing a board game in C# with the intention of getting it to run in XNA.

I don't want to get distracted with xna and graphics just yet. I want to have a working game first. The approach I am taking is:-

1. Create a console app.


2. Get it to initialise and display the board as text. Each of the 24 squares on the board is numbered (0 - 23) and the pieces are represented by red or green non-zero values. An empty square is shown as a white zero. Start squares and home squares are in blue

3. I have added code to capture how the pieces move from square to square.

4. Also added rules, for checking when the game is over and who won, and preventing any illegal moves.

5. I have added a game loop so you can play a game human vs human.

This is working well so far, but the display is not easy to read in a console app.

12 August 2009

Notes on Open University Course T206_2 An introduction to sustainable energy

A free course from the Open University

1 Why sustainable energy matters
Current use of fossil fuels not sustainable.
Finite supply(but not about to run out immediately)

Location of 2 thirds of oil in Middle East or N. Africa - has led to conflict.
Price rises led to protests. (Renewables need to enable the same level of affluence that fossil fuels have enabled, else acceptance will be low)
Accidents during extraction, distribution and use.
Pollutants from use. And CO2 leading to climate change affecting ecosystems, agriculture, sea levels
Nuclear is source of 7 percent of primary energy
No green house gases, but...Supply of uranium also limited (decades or possibly centuries at current rate of use), proliferation of weapons, problems of disposal and cleanup.
Efficiency of systems is an important factor in mitigating the effects of energy use.

Renewables - Replenished by natural processes.
Solar energy, bioenergy, hydroelectricity, wind and wave power
Current costs can be higher than conventional sources, slows take up.
Need:-
  • To reduce impact of fossil and nuclear
  • To develop and deploy renewables
  • To improve efficiency of conversion, distribution and use
2 Definitions: Energy, Sustainability and the Future

Energy is the capacity to do work.
Power is the rate of doing work.
Energy = power x time
Sustainable development is ‘development that meets the needs of the present without compromising the ability of future generations to meet their own needs ’ (United Nations, 1987).

3 Present Energy Sources and Sustainability

80% of energy comes from fossil fuel at present
At current rate-200 years of coal, 60 years gas, 40 years oil

Hydrocarbons release co2 on combustion, a greenhouse gas.

Nuclear:Energy released by splitting uranium atoms (fission)
Major concerns are safety and disposal of waste
Biofuel:Combustion of straw and forestry waste. Incomplete combustion can release pollutants. Only sustainable if trees replanted ( also only sustainable if biodiversity of resource is maintained.)
Hydroelectricity 17% of electricity produced in 2000 came from hydroelectric.
- indirectly solar power from evaporation of water to rain

14 June 2009

Bee pictures

Here is a view inside the hive. The bees are mostly on five frames:-


Rachel with some of the bees on a new frame:-

Me, posing with the hive:-



18 December 2008

Free .NET training

Free training from Inner Workings (via Eric Nelson).

14 April 2008

Jottit

I have just tried out Jottit for the first time, it seems to be a very friendly wiki-like web site. It is free.

Jottit makes it very easy to create and edit web pages, almost a friction free publishing experience.

My site is here. I don't know if it will catch on with me for frequent use, but I'll try anything new. Especially if it is free.

06 March 2008

Mix08

Tim Sneath wrote a wonderful blog post on the Mix08 keynote.

The Mix08 sessions are appearing online now...

13 February 2008

ASP.NET wiki

There is now a wiki on ASP.Net

05 February 2008

MSDN Code Gallery

MSDN Code Gallery is a new community site for code samples, snippets and resources...

22 November 2007

Silverlight Training

Free Silverlight Essential Training on Lynda.com, by Mike Harsh.

18 September 2007

DDD6

DDD6 has been announced for November 24th.

With SqlBits on the 6th October, I can't help wondering when the next WebDD will be?

03 September 2007

SQLBits

SQLBits is a community conference on all things SQL, to be held at Microsoft Reading on 6th October. It's free.

17 July 2007

Galaxy Zoo

Galaxy Zoo is a site where you can help to classify galaxies, up to a million of them if you have the time...

A lot of them look very fuzzy, but then they are far away and long ago...

09 July 2007

Scott Guthrie videos

Phil Winstanley has made four videos of Scott Guthrie available on the WebDD website. These were really good sessions, so it is worth downloading them...