Blackjack

Technical Manual

Last Modified: January 02, 2025 by K. Borchert (katjab@millisecond.com), Millisecond

Script Copyright © Millisecond Software, LLC

Background

This sample script shows how to implement the game of Blackjack with Inquisit.

Duration

variable (player can quit at any point)

Procedure

- number of games up to player

Each Game:
- both dealer and player get two cards
- player can decide to draw up to three more cards (if below or at 21; if over 21 but at least one ace then
the total is adjusted down by 10) by hitting 'hit' or stand down by hitting 'stand'
=> if player cards add up to more than 21, then the player automatically loses
- if player stands down, dealer can draw up to three more cards (if below or at 17; if over 21 but at least one ace
then the total is adjusted down by 10)
=> if dealer cards add up to more than 21, then the dealer automatically loses

Rules
=> if player cards add up to more than 21 (taking into account all drawn player aces which reduce the total by -10 each for values), then the player automatically loses
=> if dealer cards add up to more than 21 (taking into account all drawn dealer aces), then the player automatically loses
=> if both have the same value <= 21, then it's a draw
=> otherwise the player with the higher number wins

Summary Data

File Name: blackjack_summary*.iqdat

Data Fields

NameDescription
inquisit.version Inquisit version number
computer.platform Device platform: win | mac |ios | android
computer.touch 0 = device has no touchscreen capabilities; 1 = device has touchscreen capabilities
computer.hasKeyboard 0 = no external keyboard detected; 1 = external keyboard detected
startDate Date the session was run
startTime Time the session was run
subjectId Participant ID
groupId Group number
sessionId Session number
elapsedTime Session duration in ms
completed 0 = Test was not completed
1 = Test was completed
games Counts the number of games played
pwins Counts the number of times the player won
dwins Counts the number of times the dealer won
draws Counts the number of draws

Raw Data

File Name: blackjack_raw*.iqdat

Data Fields

NameDescription
build Inquisit version number
computer.platform Device platform: win | mac |ios | android
computer.touch 0 = device has no touchscreen capabilities; 1 = device has touchscreen capabilities
computer.hasKeyboard 0 = no external keyboard detected; 1 = external keyboard detected
date Date the session was run
time Time the session was run
subject Participant ID
group Group number
session Session number
blockcode The name the current block (built-in Inquisit variable)
blocknum The number of the current block (built-in Inquisit variable)
trialcode The name of the currently recorded trial (built-in Inquisit variable)
trialnum The number of the currently recorded trial (built-in Inquisit variable)
trialnum is a built-in Inquisit variable; it counts all trials run
even those that do not store data to the data file.
response The participant's response (selected button)
latency The response latency (in ms); measured from:onset of current trial
dealerHand Sum of the dealer's cards
playerHand Sum of the player's cards
outcome "p win", "d win", "draw"
dCard1 Value of dealer card1
dCard2 Value of dealer card2
dCard3 Value of dealer card3
dCard4 Value of dealer card4
dCard5 Value of dealer card5
pCard1 Value of participant card1
pCard2 Value of participant card2
pCard3 Value of participant card3
pCard4 Value of participant card4
pCard5 Value of participant card5