Bingo

Bingo 30 Random Number Generator

1. Materials Needed:
Bingo Cards: Each player gets a Bingo card with a 5×5 grid. Each square is filled with a random number (except for the center square, which is often a “free space”).

Caller’s Numbers: A caller will randomly select numbers and announce them to the players. These numbers are typically between 1 and 75.

2. Setup:
Players each have their own Bingo card, and they mark off numbers as they are called out.

The goal is to get a specific pattern on your card. The most common pattern is a straight line, either horizontally, vertically, or diagonally. Some games may use other patterns, like a full card (coverall), four corners, or other designs.

3. How to Play:
The caller randomly selects and announces a number (e.g., “B-10”, “I-23”).

Players look at their Bingo cards to see if the number appears.

If the number is on their card, they mark it off (usually with a chip, pen, or marker).

The first player to complete the designated pattern (such as a full line or all squares) shouts “Bingo!” to signal they’ve won.

4. Winning:
When a player calls “Bingo!”, the game pauses, and the caller checks the player’s card to confirm the pattern.

If the pattern is correct, that player wins the round and often receives a prize.

If no one calls “Bingo!” after a certain time, the game continues until someone wins.

5. Multiple Rounds:
Bingo can be played in multiple rounds, with players using new cards for each round.

It’s a simple and social game, usually requiring little strategy, but it’s exciting due to the anticipation of winning.

Charades

How to Play: Players take turns miming a word or phrase for others to guess. You can have a theme like “classic movies,” “famous places,” or “family memories.”

Why It’s Fun: It’s lively and requires no special materials, so you can play anytime.

VBA Function to allow alteration of Key Mapping for Multi-lingual support

Important
Proviso : bear in mind that different Windows operating system versions have different support for languages – with Windows 7 you require ultimate version of the OS and then you have to ensure that the required language pack is installed – happy to say that Win 8 has language support as standard although you will need to specifically request certain regional input options within the settings. Windows 10 is similar, language support is free although it is likely you will have to specifically configure languages if there is more than one. My environment when I first solved this was Windows 7 ultimate.

So the problem – You are multi-lingual (or trying to be) and you regurlaly need to change mapping of your keyboard between alphabets (you can also touch type in both alphabets). You can do it manually everytime you need to change but it’s a pain, you have a database with fields some of which are in one language the others of which are in another language. You would like to alter keyboard mapping to specific languages on entering particular fields but how do you do it?

The following uses the Windows API to change the keyboard language globally. This can be done through VBA in MS Access no problem remembering the provisio that your OS must support your chosen language.

Firstly place the following in a module (note no end function required)

Public Declare Function ActivateKeyboardLayout Lib "user32.dll" (ByVal myLanguage As Long, Flag As Boolean) As Long 'define your desired keyboardlanguage

Then you can call the function from any form event.
Eg on field GotFocus and LostFocus

'1049 Russian keyboard language layout
'2057 English(United Kingdom)keyboard language layout
'1033 English (United States) keyboard language layout

Private Sub A_GotFocus()
Call ActivateKeyboardLayout(1049, 0)
End Sub

Private Sub A_LostFocus()
Call ActivateKeyboardLayout(2057, 0)
End Sub

You can find the LCID decimal codes here
Microsoft Windows Location Identifier Codes LCID

Wax on Wax off

IMGP0087
One of the most useful and easy improvements I ever made to working was simply learning how to touch type. Its never been particularly necessary for programming as I find anytime I’m programming I write relatively little and the combination of tabs,  weird characters, automatic code generation, intellisense and strange syntax results in a fairly uniform speed, touch typing or otherwise. No were it tends to be useful is simply for smashing out quick communications with individuals. If things are going well things tend to change quickly. Yes I need that no hang on things have changed cancel that have you got this?  That kind of thing. This is were it helps to have a work colleague who is also a quick typist and a quick responder.

So I went out and bought what is called a mechanical keyboard from Das Keyboard (link to their site below) a name I might add was quickly noted as somewhat inaccurate. A colleague immediately pointing out that a mechanical keyboard really has no electronic parts whatsoever like the old key and lever ones you sometimes see in old black and white films.

http://www.daskeyboard.com/model-s-ultimate/

I settled on a the S Ultimate model which has no labels on the keys. I figured hey I’ve started a bit of Russian if you change the key mapping to cyrillics any letters are useless anyway so lets go hard core. It arrived at my work and female colleague no 1 enjoyed watching me eagerly unpack and plug it in. Now I thought I was a touch typist. Turns out that wasn’t quite true. To register the keyboard I had to re-start  the OS. Fine except I immediately had to re-enter my password to get to desktop. Three times later I had to phone support to unblock my password. Yep you guessed it I wasn’t quite the Ninja touch type artist I had fully convinced myself I was.

I’m down with it now but it did require me upping my game. I am particularly careful using some of the USB sticks as those that are encrypted have a three strikes and your out policy  with NO recovery – that did slightly concern me.

So what is it like as a keyboard.

I was immediately about 4% faster I have raised my average speed from about 59 words per minute to something like 66 words per minute. On the rare occasion that I don’t make any typing mistakes I can get up to 75. Think of the discipline some must have had to use the old mechanical keyboards I’m sure that the requirement to use typex would have concentrated the mind on not making mistakes.

It makes me think that maybe Das Keyboard should do a special keyboard with the option for electrifying the delete key.

I am writing a letter now.

The Economics of Immortality

Its 2021 and I originall wrote this article back in 2014 – It sounded on a reread just plain wrong so.

I still maintain that programs should be in some way immortal and maybe wordpress is a case in point. I’ve updated and changed my blog and it runs today better than it ever did. Yes wordpress may change and there is a requirement that it should be updated but how long could it be maintained without maintenance.. Quite probably for a time close to forever.

VBA Function Collection for converting Eastings and Northings to Latitude and Longitude

Some years back we hired a young lad by the name of Iain Brodie on a temporary contract – The week before I had been at an ESRI conference which had extensively discussed Web Mapping and  a speaker had demonstrated showing points in Google Maps. It was clear to me that the Google Maps url would accept and zoom to coordinates if those coordinates passed to it were Longitude and Latitude. Where I work there are significant numbers of datasets that use old Ordnance Survey UK specific Eastings and Northings coordinate system. Ordnance Survey actually set out the mathematics of conversion to Lat and Long on this page even detailing coded functions albeit in Javascript.

http://www.movable-type.co.uk/scripts/latlong-gridref.html

I specifically wanted to dynamically convert using Visual Basic for applications (specifically from MS Access). When Iain arrived it was clear that he was useful with computers and so I tasked him with finding VBA code from the internet. Between us we managed to get it working and I still regularly use the function set today to give users of applications a map in Google Maps. It really is a very nice quick tool that gives users quick access to maps for – you bet zero cost. My favourite price. We originally had it working with Google Earth but I only use it with Google Maps now.

Function PHId(North1, N0, aFo, PHI0, n, bFo)
PHI1 = ((North1 - N0) / aFo) + PHI0
M = Marc(bFo, n, PHI0, PHI1)
PHI2 = ((North1 - N0 - M) / aFo) + PHI1
Do While Abs(North1 - N0 - M) > 0.00001
PHI2 = ((North1 - N0 - M) / aFo) + PHI1
M = Marc(bFo, n, PHI0, PHI2)
PHI1 = PHI2
Loop
PHId = PHI2
End Function

Function Marc(bFo, n, P1, P2)
Marc = bFo * (((1 + n + ((5 / 4) * (n ^ 2)) + ((5 / 4) * (n ^ 3))) * (P2 - P1)) - (((3 * n) + (3 * (n ^ 2)) + ((21 / 8) * (n ^ 3))) * (Sin(P2 - P1)) * (Cos(P2 + P1))) + ((((15 / 8) * (n ^ 2)) + ((15 / 8) * (n ^ 3))) * (Sin(2 * (P2 - P1))) * (Cos(2 * (P2 + P1)))) - (((35 / 24) * (n ^ 3)) * (Sin(3 * (P2 - P1))) * (Cos(3 * (P2 + P1)))))
End Function

Function lon(East1, North1)
a = 6377563.396
b = 6356256.91
F0 = 0.9996012717
E0 = 400000
N0 = -100000
PHI0 = 0.855211333
LAM0 = -0.034906585
aFo = a * F0
bFo = b * F0
e2 = (aFo ^ 2 - bFo ^ 2) / aFo ^ 2
n = (aFo - bFo) / (aFo + bFo)
InitPHI = PHId(North1, N0, aFo, PHI0, n, bFo)
nuPL = aFo / ((1 - (e2 * (Sin(InitPHI)) ^ 2)) ^ 0.5)
rhoPL = (nuPL * (1 - e2)) / (1 - (e2 * (Sin(InitPHI)) ^ 2))
eta2PL = (nuPL / rhoPL) - 1
M = Marc(bFo, n, PHI0, InitPHI)
Et = East1 - E0
X = ((Cos(InitPHI)) ^ -1) / nuPL
XI = (((Cos(InitPHI)) ^ -1) / (6 * nuPL ^ 3)) * ((nuPL / rhoPL) + (2 * ((Tan(InitPHI)) ^ 2)))
XII = (((Cos(InitPHI)) ^ -1) / (120 * nuPL ^ 5)) * (5 + (28 * ((Tan(InitPHI)) ^ 2)) + (24 * ((Tan(InitPHI)) ^ 4)))
XIIA = (((Cos(InitPHI)) ^ -1) / (5040 * nuPL ^ 7)) * (61 + (662 * ((Tan(InitPHI)) ^ 2)) + (1320 * ((Tan(InitPHI)) ^ 4)) + (720 * ((Tan(InitPHI)) ^ 6)))
lon = (LAM0 + (Et * X) - ((Et ^ 3) * XI) + ((Et ^ 5) * XII) - ((Et ^ 7) * XIIA))
End Function

Function lat(East1, North1)
a = 6377563.396
b = 6356256.91
F0 = 0.9996012717
E0 = 400000
N0 = -100000
PHI0 = 0.855211333
LAM0 = -0.034906585
aFo = a * F0
bFo = b * F0
e2 = (aFo ^ 2 - bFo ^ 2) / aFo ^ 2
n = (aFo - bFo) / (aFo + bFo)
InitPHI = PHId(North1, N0, aFo, PHI0, n, bFo)
nuPL = aFo / ((1 - (e2 * (Sin(InitPHI)) ^ 2)) ^ 0.5)
rhoPL = (nuPL * (1 - e2)) / (1 - (e2 * (Sin(InitPHI)) ^ 2))
eta2PL = (nuPL / rhoPL) - 1
M = Marc(bFo, n, PHI0, InitPHI)
Et = East1 - E0
VII = (Tan(InitPHI)) / (2 * nuPL * rhoPL)
VIII = ((Tan(InitPHI)) / (24 * rhoPL * nuPL ^ 3)) * (5 + (3 * ((Tan(InitPHI)) ^ 2)) + eta2PL - (9 * ((Tan(InitPHI)) ^ 2) * eta2PL))
IX = ((Tan(InitPHI)) / (720 * rhoPL * nuPL ^ 5)) * (61 + (90 * ((Tan(InitPHI)) ^ 2)) + (45 * ((Tan(InitPHI)) ^ 4)))
lat = (InitPHI - ((Et ^ 2) * VII) + ((Et ^ 4) * VIII) - ((Et ^ 6) * IX))
End Function

Function degrees(radians)
degrees = 180 * radians / 3.14159265358979
End Function

Function trunc(value)
If value > 0 Then
trunc = Int(value)
Else
trunc = Int(value + 1)
End If
End Function

And here is the code the onclick function of a button called Command01 and it pulls from a screen that has an eastings and northings field on it and which has a Sitename field.

Dim Llatitude As Double
Dim Llongitude As Double
Dim strSitename As String

Llatitude = degrees(lat([Eastings], [Northings]))
Llongitude = degrees(lon([Eastings], [Northings])) - 0.0015
strSitename = Me.Sitename
    
Dim strlatlong As String
strlatlong = Llatitude & ",+" & Llongitude

‘Here I have two options – the first places a marker on the map – as far as I can tell – the marker is only available within google with the side panel displayed as well. The second shows the map centered on the requested location but without any markers. Choose one

Command01.HyperlinkAddress = "https://maps.google.com/maps?q=" & strlatlong & "+(" & strSitename & ")&z=18&iwloc=near&hl=en&ll=" & strlatlong

Command01.HyperlinkAddress ="https://www.google.com/maps/@" & Llatitude & "," & Llongitude & ",18z?hl=en"

And for Developers wanting to get into more detail here is the url for more information on passing parameters to the google maps url.

Google Map URLs

VB Function for Zooming to location in Google Maps at 23 March 2014

mapGoogle recently slightly altered their URL to link to Google Maps. This code passes eastings and northings from fields into a function that calculates Longitude and Latitude and then passes those calculated coordinates to the google maps url for display

Note you will need to have implemented the functions that calculate lat and long for this to be useful.

Private Sub Command01_Click()

On Error GoTo Err_Command01_Click

Dim Llatitude As Double

Dim Llongitude As Double

Dim strSitename As String

Llatitude = degrees(lat([Eastings], [Northings]))

Llongitude = degrees(lon([Eastings], [Northings])) - 0.0015

strSitename = Me.Sitename

Dim strlatlong As String

strlatlong = Llatitude & ",+" & Llongitude

'From 24 March Google changed their hyperlink address this is the new one

Command01.HyperlinkAddress = "https://maps.google.com/maps?q=" & strlatlong & "+(" & strSitename & ")&z=18&iwloc=near&hl=en&ll=" & strlatlong

Exit_Command01_Click:

Exit Sub

Err_Command01_Click:

MsgBox Err.Description

Resume Exit_Command01_Click

End Sub

 

Nubuilder Pro 3 – Example Web Application Deletion and Creation – Race Number system

Objective :

Create a simple online web application that can be used to type in race numbers. Once a number is typed in the time will automatically posted to a field. This could be used to manually record numbers of competitors coming across a finish line on mobile phones provided all phones have access to a web browser and they have 4G connection or wifi connection.

First go to the administrator url and sign in with the Global Administrator username and password to get into the design form.

The format of this is

If you wish to delete a project go to the delete tab within the site select the site you wish to delete then hit Delete

It will then present you with a sanity check window

Pressing enter again you get a site administration check box again

Adding a New Site in Nubuilder Pro
Go back to the opening screen and this time go to the Add Tab.

You should be presented with an Add Dialog window.
Type in the name you wish your new project to be here I call it racenumber – note the name has to be all lower case.
Hit create after which there will be a short delay while the site is created.

There will be a short delay while the site is created

You will then be presented with the Administration panel with your new site created something like the following

Now click on the site you are interested in this case race number which will take you to the login panel

Now enter the global username and password that you were originally handed out.

Once logged in you should be presented with the following screen.

Hitting the database button will take you to the php-myadmin control panel

The First step is to create a table to hold all the data

This can be done buy using the create table button on the bottom left.

Here I am creating a table called T002Time to which I add three columns. I set the AI which stands for Auto Increment to yes and I set this field as an index I also add a time field and set the default to current_time – note that in phpmyadmin fields will not necessarily accept default functions but Time variable type accepts current_time. Current_time function returns date and time.

Here I have forgotten the racenumber field so I create some SQL to add this in.

Now we want to go back to the Nubuilder web application panel

Hit the form wizard – now select the T002Time drop down in the table name and use the add to Browse column and add to Form Objects button to transfer everything across to the respective columns as follows.

This will run and in the background create a form which you can see by going through the User Home screen as follows

Now lets remove some fields we no longer need
Go to objects we can see that three columns relate to to the T002Time(form) Lets do several things
1. Remove DTime from the form
2. Remove the Race FKID from the form
3. Change the label of the home Form button T002Timebtn to Race Numbers

Firstly in the objects button go into the two lines you wish to remove from the form

and when the object details appear delete them.

After a warning message you should be presented with the new list of object without the object recently deleted.

The new form should look something like this.

That’s 1 and 2 done now lets try and get that button bigger.

Now in here I am going to remove the RACEFKID and make the DTIME much wider

Now we see

Now lets see if we can move this field to the centre of the screen this can be done while in global administration mode by clicking on the following button

Reposition then add users and that should be you.

Mafia Game

Starting Instructions

Mafia is a game for 7 or more players where everyone imagines they live in a village. I will hand out cards and according to what the cards are you will adopt a different role. The cards have the character you will be playing on them. The game’s objective is for everyone to identify who are the Mafia players in the village. The game ends when there are more Mafia players

The Mafia wins if they equal or outnumber the civilians.

The Civilians win if they successfully eliminate all Mafia members.
There will be a day night cycle …

Roles for nine people
1 Narrator
4 Civilians
2 Mafia
1 Sheriff
1 Doctor

Start of the game

Introduction
In our sleepy village, rumors have begun to spread. Whispers of a hidden Mafia in our midst have turned our peaceful days into ones of suspicion. We have gathered a small group of brave civilians, but some of us are not who we seem. Among us are those who would destroy our community, and it is up to the Sheriff, the Doctor, and all of you as civilians to work together to find and eliminate them. To maintain the safety of the Sheriff and the Doctor they cannot reveal themselves

Start of the NIGHT cycle

“As the moon rises over our quiet village, the Mafia wake up in the shadows. Their eyes gleam as they plan their next move. The Doctor, however, is always watching for signs of danger, ready to protect the innocent.”.

Everyone close your eyes
Night Phase:
Mafia: “Mafia, open your eyes and silently point to your next victim. Remember, you are hiding among the villagers, and your decision must be made in secret.”

Sheriff: “Sheriff, you are waking up to investigate. Open your eyes and silently point to the person you suspect to be Mafia, and your decision must be made in secret.”

Doctor: “Doctor, now it’s your turn to act. Open your eyes and point to the person to save from the Mafia’s wrath.”

Civilians please wake up and I will give each of you a chance to talk and say what you think consecutively.

But first I have news from last night

Narrator chooses the option
Version 1 (Mafia kills a civilian): “The Mafia struck again last night. One of our dear citizens, Civilian X, was found lifeless this morning. Let us honor their memory and continue our search for the culprits.”

Version 2 (Doctor saves the victim): “A chilling night has passed, but thanks to our Doctor’s quick thinking, the Mafia’s attack failed. Our target survives—but the threat still lingers in the shadows.”

Version 3 (Sheriff arrests Mafia): “The Sheriff has acted swiftly tonight. A Mafia member has been captured! Civilian B was hiding among us, but no more. They have been removed from the game.”

Player Discussion
Players consecutively discuss their suggestions as to who is innocent and who is not innocent

Voting Process (Day Cycle):
The voting process should be more structured and emphasize the importance of discussion and deduction. Consider adding a formal structure for the voting process.
Voting Process:

Discuss: “You now have 15 minutes to discuss among yourselves who you believe is a Mafia member. Use your intuition and any clues from the night cycle.”

Vote: “Once the discussion is over, each civilian will raise their hand to vote on who they believe is a Mafia member.”

Outcome: “The narrator will reveal whether the vote was correct or not. The voted civilian will be removed from the game, regardless of whether they are Mafia or not.”
Repeat to the Night Cycle
Endgame and Victory Conditions:
Make sure the game’s end conditions are explicitly stated at the beginning and reiterated as the game progresses.
Game End Conditions:

The Mafia wins if they equal or outnumber the civilians.

The Civilians win if they successfully eliminate all Mafia members.