注册一亩三分地论坛,查看更多干货!
您需要 登录 才可以下载或查看附件。没有帐号?注册账号 
x
// A struct for representing a 3D Vector with a constructor
struct Vector3. Waral dи,
{. From 1point 3acres bbs
float x;
float y;
float z;
.1point3acres Vector3( float xIn, float yIn, float zIn )
{. ----
x = xIn;
y = yIn;.
z = zIn;
}
};.google и
. 1point3acres.com
// Function Declarations
void TreyArch( int Trey, int Arch, int n );
void PlayerInfo( int stats );
bool CanHearSniper( Vector3 listenerPosition, Vector3 sniperPosition, Vector3 sniperForward, float distance, float cone );
// Main
// Calls functions with sample inputs
// No need to modify this function
int main()
{
TreyArch( 3, 5, 15 );
PlayerInfo( 3411782069 );
CanHearSniper( Vector3( 0.0f, 0.0f, 0.0f ), Vector3( 1000.0f, 0.0f, 0.0f ), Vector3( -1.0f, 0.0f, 0.0f ), 1100.7f, 10 );
return 0;
}
/////////////////////////////////////
// PLACE ALL CODE BELOW THIS BLOCK //
/////////////////////////////////////
// Problem 1
// TreyArch
// For each number starting from 1 and going up to n, this function prints the following
// "Trey" - If the number is a multiple of Trey OR contains the digit Trey. 1point3acres
// "Arch" - If the number is a multiple of Arch OR contains the digit Arch
// "TreyArch" - If the number falls into both categories above
// The number itself if none of the rules above hold for that number
// n - the number up to which this function prints
// Trey - first digit 3 - 9
// Arch - second digit 3 - 9
/*
Sample Input. 1point3acres
-----------------------------------------------------------
3 5 15
Sample Output
-----------------------------------------------------------
1 2 Trey 4 Arch Trey 7 8 Trey Arch 11 Trey Trey 14 TreyArch
*/
void TreyArch( int Trey, int Arch, int n ). 1point3acres.com
{
}
// Time:
. Χ
// Problem 2
. ----
// PlayerInfo
// Prints the player info stored inside the stats passed in
// From least significant to most significant bits:. 1point3acres
// Bits 0 - 7 contain the players kills Print Number
// Bits 8 - 15 contain the players deaths Print Number
// Bits 16 - 17 contain the players weapon class Print "Assault" "SMG" "LMG" or "Sniper"
// Bit 18 is handedness: 1 for right, 0 for left Print "Right Hand" or "Left Hand"
// Bits 19 - 22 contain the players setting for vertical look sensitivity Print Number
// Bits 23 - 26 contain the players setting for horizontal look sensitivity Print Number.--
// Bits 27 - 30 contain the players setting for auto-aim sensitivity Print Number
// Bit 31 is if the player is getting an internship at Treyarch: 1 for yes, 0 for no Print "Yes" or "No"
// stats - the stats blob passed in
-baidu 1point3acres
/*
Sample Input
-----------------------------------------------------------. From 1point 3acres bbs
3411782069
Sample Output
-----------------------------------------------------------. 1point3acres
Kills: 181
Deaths: 169
Class: Sniper
Hand: Left Hand ..
Vertical Look Sensitivity: 11
Horizontal Look Sensitivity: 6
Auto-Aim Sensitivity: 9
Internship: Yes
*/
enum PlayerWeaponClass
{-baidu 1point3acres
PWD_ASSAULT,
PWD_SMG,
PWD_LMG,
PWD_SNIPER,
PWD_COUNT,
};
void PlayerInfo( int stats )
{
}
// Time:
. Χ
// Problem 3
// CanHearSniper
// Task - Complete the function to determine if a player can hear a sniper's gunfire
// Prints true or false for debug purposes. .и
// listenerPosition - The 3d position of the player listening. Χ
// sniperPosition - The 3d world position of the sniper
// sniperForward - The normalized vector of the direction that the sniper is firing in.--
// distance - the max distance that the sniper can be heard from
// cone - the max angle in DEGREES that the sniper's gunfire can be heard in ( 0 - 360 )
/*. .и
Sample Input
-----------------------------------------------------------
Vector3( 0.0f, 0.0f, 0.0f ), Vector3( 1000.0f, 0.0f, 0.0f ), Vector3( -1.0f, 0.0f, 0.0f ), 1100.7f, 10. 1point 3acres
Sample Output
-----------------------------------------------------------
true.1point3acres
*/
bool CanHearSniper( Vector3 listenerPosition, Vector3 sniperPosition, Vector3 sniperForward, float distance, float cone ). 1point 3 acres
{
return false;
}
// Time:
|